|
AVPKit
|


Public Member Functions | |
| VS_JNIUTILS_REFCOUNTED_OBJECT (Packet) | |
| virtual int64_t | getTimeStamp () |
| Get the time stamp of this object in getTimeBase() units. More... | |
| virtual void | setTimeStamp (int64_t aTimeStamp) |
| Set the time stamp for this object in getTimeBase() units. More... | |
| virtual bool | isKey () |
| Is this object a key object? i.e. More... | |
| virtual IRational * | getTimeBase () |
| Get the time base that time stamps of this object are represented in. More... | |
| virtual void | setTimeBase (IRational *aBase) |
| Set the time base that time stamps of this object are represented in. More... | |
| virtual void | reset () |
| Clear out any data in this packet, but leaves the buffer available for reuse. | |
| virtual int64_t | getPts () |
| Get the Presentation Time Stamp (PTS) for this packet. More... | |
| virtual int64_t | getDts () |
| Get the Decompression Time Stamp (DTS) for this packet. More... | |
| virtual int32_t | getSize () |
| Get the size in bytes of the payload currently in this packet. More... | |
| virtual int32_t | getMaxSize () |
| Get the maximum size (in bytes) of payload this packet can hold. More... | |
| virtual int32_t | getStreamIndex () |
| Get the container-specific index for the stream this packet is part of. More... | |
| virtual int32_t | getFlags () |
| Get any flags set on this packet, as a 4-byte binary-ORed bit-mask. More... | |
| virtual bool | isKeyPacket () |
| Does this packet contain Key data? i.e. More... | |
| virtual int64_t | getDuration () |
| Return the duration of this packet, in units of getTimeBase(). More... | |
| virtual int64_t | getPosition () |
| Return the position (in bytes) of this packet in the stream. More... | |
| virtual com::avpkit::ferry::IBuffer * | getData () |
| Get any underlying raw data available for this object. More... | |
| virtual int32_t | allocateNewPayload (int32_t payloadSize) |
| Discard the current payload and allocate a new payload. More... | |
| virtual bool | isComplete () |
| Is this packet complete. More... | |
| virtual void | setKeyPacket (bool keyPacket) |
| Set if this is a key packet. More... | |
| virtual void | setFlags (int32_t flags) |
| Set any internal flags. More... | |
| virtual void | setPts (int64_t pts) |
| Set a new Presentation Time Stamp (PTS) for this packet. More... | |
| virtual void | setDts (int64_t dts) |
| Set a new Decompression Time Stamp (DTS) for this packet. More... | |
| virtual void | setComplete (bool complete, int32_t size) |
| Set if this packet is complete, and what the total size of the data should be assumed to be. More... | |
| virtual void | setStreamIndex (int32_t streamIndex) |
| Set the stream index for this packet. More... | |
| virtual void | setDuration (int64_t duration) |
| Set the duration. More... | |
| virtual void | setPosition (int64_t position) |
| Set the position. More... | |
| virtual void | setData (com::avpkit::ferry::IBuffer *buffer) |
| Sets the underlying buffer used by this object. More... | |
| AVPacket * | getAVPacket () |
| void | wrapAVPacket (AVPacket *pkt) |
| void | wrapBuffer (com::avpkit::ferry::IBuffer *buffer) |
Public Member Functions inherited from com::avpkit::ferry::RefCounted | |
| virtual int32_t | acquire () |
| Internal Only. More... | |
| virtual int32_t | release () |
| Internal Only. More... | |
| virtual RefCounted * | copyReference () |
| Create a new Java object that refers to the same native object. More... | |
| virtual int32_t | getCurrentRefCount () |
| Return the current reference count on this object. More... | |
| void | setJavaAllocator (void *allocator) |
| This method is public but not part of the standard API. More... | |
| void * | getJavaAllocator () |
| This method is public but not part of the standard API. More... | |
Static Public Member Functions | |
| static Packet * | make (int32_t payloadSize) |
| static Packet * | make (com::avpkit::ferry::IBuffer *buffer) |
| static Packet * | make (Packet *packet, bool) |
| static void | freeAVBuffer (void *buf, void *closure) |
Static Public Member Functions inherited from com::avpkit::core::IPacket | |
| static IPacket * | make () |
| Allocate a new packet. More... | |
| static IPacket * | make (com::avpkit::ferry::IBuffer *buffer) |
| Allocate a new packet that wraps an existing IBuffer. More... | |
| static IPacket * | make (IPacket *packet, bool copyData) |
| Allocate a new packet wrapping the existing contents of a passed in packet. More... | |
| static IPacket * | make (int32_t size) |
| Allocate a new packet. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from com::avpkit::ferry::RefCounted | |
| virtual void | destroy () |
| This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed. | |
Protected Attributes inherited from com::avpkit::ferry::RefCounted | |
| AtomicInteger * | mRefCount |
| This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe. | |
| void * | mAllocator |
| Not part of public API. | |
|
virtual |
Discard the current payload and allocate a new payload.
Note that if any people have access to the old payload using getData(), the memory will continue to be available to them until they release their hold of the IBuffer.
When requesting a packet size, the system may allocate a larger payloadSize.
| payloadSize | The (minimum) payloadSize of this packet in bytes. |
Implements com::avpkit::core::IPacket.
Definition at line 309 of file Packet.cpp.
References com::avpkit::ferry::Buffer::make().
Referenced by com::avpkit::core::StreamCoder::encodeAudio(), and com::avpkit::core::StreamCoder::encodeVideo().
|
virtual |
Get any underlying raw data available for this object.
Implements com::avpkit::core::IMediaData.
Definition at line 173 of file Packet.cpp.
Referenced by com::avpkit::core::StreamCoder::decodeAudio(), com::avpkit::core::StreamCoder::decodeVideo(), com::avpkit::core::StreamCoder::encodeAudio(), and com::avpkit::core::StreamCoder::encodeVideo().
|
virtual |
Get the Decompression Time Stamp (DTS) for this packet.
This is the time at which the payload for this packet should be decompressed, in units of getTimeBase(), relative to the start of stream.
Some media codecs can require packets from the "future" to be decompressed before earliest packets as an additional way to compress data. In general you don't need to worry about this, but if you're curious start reading about the difference between I-Frames, P-Frames and B-Frames (or Bi-Directional Frames). B-Frames can use information from future frames when compressed.
Implements com::avpkit::core::IPacket.
Definition at line 75 of file Packet.cpp.
Referenced by getTimeStamp(), and com::avpkit::core::Container::readNextPacket().
|
virtual |
Return the duration of this packet, in units of getTimeBase().
Implements com::avpkit::core::IPacket.
Definition at line 149 of file Packet.cpp.
Referenced by com::avpkit::core::Container::readNextPacket().
|
virtual |
Get any flags set on this packet, as a 4-byte binary-ORed bit-mask.
This is access to raw FFMPEG flags, but it is easier to use the is* methods below.
Implements com::avpkit::core::IPacket.
Definition at line 102 of file Packet.cpp.
Referenced by com::avpkit::core::Container::readNextPacket().
|
virtual |
Get the maximum size (in bytes) of payload this packet can hold.
Implements com::avpkit::core::IPacket.
Definition at line 92 of file Packet.cpp.
|
virtual |
Return the position (in bytes) of this packet in the stream.
Implements com::avpkit::core::IPacket.
Definition at line 161 of file Packet.cpp.
Referenced by com::avpkit::core::Container::readNextPacket().
|
virtual |
Get the Presentation Time Stamp (PTS) for this packet.
This is the time at which the payload for this packet should be presented to the user, in units of getTimeBase(), relative to the start of stream.
Implements com::avpkit::core::IPacket.
Definition at line 63 of file Packet.cpp.
Referenced by com::avpkit::core::StreamCoder::decodeAudio(), and com::avpkit::core::Container::readNextPacket().
|
virtual |
Get the size in bytes of the payload currently in this packet.
Implements com::avpkit::core::IPacket.
Definition at line 87 of file Packet.cpp.
Referenced by com::avpkit::core::StreamCoder::decodeAudio(), com::avpkit::core::StreamCoder::decodeVideo(), com::avpkit::core::StreamCoder::encodeAudio(), and com::avpkit::core::Container::readNextPacket().
|
virtual |
Get the container-specific index for the stream this packet is part of.
Implements com::avpkit::core::IPacket.
Definition at line 97 of file Packet.cpp.
Referenced by com::avpkit::core::Container::readNextPacket(), and com::avpkit::core::Container::writePacket().
|
inlinevirtual |
Get the time base that time stamps of this object are represented in.
Caller must release the returned value.
Implements com::avpkit::core::IMediaData.
|
inlinevirtual |
Get the time stamp of this object in getTimeBase() units.
Implements com::avpkit::core::IMediaData.
Definition at line 46 of file Packet.h.
References getDts().
|
virtual |
Is this packet complete.
Implements com::avpkit::core::IPacket.
Definition at line 384 of file Packet.cpp.
Referenced by com::avpkit::core::Container::writePacket().
|
inlinevirtual |
Is this object a key object? i.e.
it can be interpreted without needing any other media objects
Implements com::avpkit::core::IMediaData.
Definition at line 48 of file Packet.h.
References isKeyPacket().
|
virtual |
Does this packet contain Key data? i.e.
data that needs no other frames or samples to decode.
Implements com::avpkit::core::IPacket.
Definition at line 107 of file Packet.cpp.
Referenced by isKey().
|
virtual |
Set if this packet is complete, and what the total size of the data should be assumed to be.
| complete | True for complete, false for not. |
| size | Size of data in packet. |
Implements com::avpkit::core::IPacket.
Definition at line 132 of file Packet.cpp.
|
virtual |
Sets the underlying buffer used by this object.
This is an advanced method and is not recommended for use by those who don't fully understand how IBuffers work. Implementations of IMediaData may behave in undefined ways if the buffer you pass in is not big enough for what you ask them to do (e.g. they may discard your buffer and allocate a larger one if they need more space). It is up to the caller to ensure the buffer passed in is large enough, and is not simultaneously in use by another part of the system.
| buffer | The buffer to set. If null, this method is ignored. |
Implements com::avpkit::core::IMediaData.
Definition at line 356 of file Packet.cpp.
|
virtual |
Set a new Decompression Time Stamp (DTS) for this packet.
| aDts | a new DTS for this packet. |
Implements com::avpkit::core::IPacket.
Definition at line 81 of file Packet.cpp.
Referenced by setTimeStamp().
|
virtual |
Set the duration.
| duration | new duration |
Implements com::avpkit::core::IPacket.
Definition at line 155 of file Packet.cpp.
|
virtual |
Set any internal flags.
| flags | Flags to set |
Implements com::avpkit::core::IPacket.
Definition at line 125 of file Packet.cpp.
|
virtual |
Set if this is a key packet.
| keyPacket | true for yes, false for no. |
Implements com::avpkit::core::IPacket.
Definition at line 113 of file Packet.cpp.
|
virtual |
Set the position.
| position | new position |
Implements com::avpkit::core::IPacket.
Definition at line 167 of file Packet.cpp.
|
virtual |
Set a new Presentation Time Stamp (PTS) for this packet.
| aPts | a new PTS for this packet. |
Implements com::avpkit::core::IPacket.
Definition at line 69 of file Packet.cpp.
|
virtual |
Set the stream index for this packet.
| streamIndex | The stream index, as determined from the IContainer this packet will be written to. |
Implements com::avpkit::core::IPacket.
Definition at line 143 of file Packet.cpp.
|
inlinevirtual |
Set the time base that time stamps of this object are represented in.
| aBase | the new time base. If null an exception is thrown. |
Implements com::avpkit::core::IMediaData.
Definition at line 50 of file Packet.h.
Referenced by com::avpkit::core::Container::readNextPacket().
|
inlinevirtual |
Set the time stamp for this object in getTimeBase() units.
| aTimeStamp | The time stamp |
Implements com::avpkit::core::IMediaData.
Definition at line 47 of file Packet.h.
References setDts().