|
AVPKit
|


Public Member Functions | |
| virtual Direction | getDirection () |
| Get the Direction this stream is pointing in. More... | |
| virtual int | getIndex () |
| Get the relative position this stream has in the hosting IContainer object. More... | |
| virtual int | getId () |
| Return a container format specific id for this stream. More... | |
| virtual IStreamCoder * | getStreamCoder () |
| Get the StreamCoder than can manipulate this stream. More... | |
| virtual IRational * | getFrameRate () |
| Get the (sometimes estimated) frame rate of this container. More... | |
| virtual IRational * | getTimeBase () |
| The time base in which all timestamps (e.g. More... | |
| virtual int64_t | getStartTime () |
| Return the start time, in getTimeBase() units, when this stream started. More... | |
| virtual int64_t | getDuration () |
| Return the duration, in getTimeBase() units, of this stream, or Global#NO_PTS if unknown. More... | |
| virtual int64_t | getCurrentDts () |
| The current Decompression Time Stamp that will be used on this stream, in getTimeBase() units. More... | |
| virtual int | getNumIndexEntries () |
| Get the number of index entries in this stream. More... | |
| virtual int64_t | getNumFrames () |
| Returns the number of encoded frames if known. More... | |
| virtual void | setTimeBase (IRational *) |
| virtual void | setFrameRate (IRational *) |
| virtual int | containerClosed (Container *container) |
| virtual int32_t | acquire () |
| Internal Only. More... | |
| virtual int32_t | release () |
| Internal Only. More... | |
| virtual IRational * | getSampleAspectRatio () |
| Added in 1.17. More... | |
| virtual void | setSampleAspectRatio (IRational *newRatio) |
| Sets the sample aspect ratio. More... | |
| virtual const char * | getLanguage () |
| Get the 4-character language setting for this stream. More... | |
| virtual void | setLanguage (const char *language) |
| Set the 4-character language setting for this stream. More... | |
| virtual IContainer * | getContainer () |
| Get the underlying container for this stream, or null if AVPKit doesn't know. More... | |
| virtual IStream::ParseType | getParseType () |
| Get how the decoding codec should parse data from this stream. More... | |
| virtual void | setParseType (ParseType type) |
| Set the parse type the decoding codec should use. More... | |
| virtual int | setBitstreamFilter (const char *name) |
| Set a bitstream filter on this stream. More... | |
| virtual int32_t | setStreamCoder (IStreamCoder *coder) |
| Sets the stream coder to use for this stream. More... | |
| virtual AVStream * | getAVStream () |
| virtual AVBSFContext * | getAVBsfContext () |
| virtual IMetaData * | getMetaData () |
| Get the IMetaData for this object, or null if none. More... | |
| virtual void | setMetaData (IMetaData *metaData) |
| Set the IMetaData on this object, overriding any previous meta data. More... | |
| virtual int32_t | stampOutputPacket (IPacket *packet) |
| Takes a packet destined for this stream, and stamps the stream index, and converts the time stamp to the correct units (adjusting for rounding errors between stream conversions). More... | |
| virtual int32_t | setStreamCoder (IStreamCoder *newCoder, bool assumeOnlyStream) |
| Sets the stream coder to use for this stream. More... | |
| virtual IIndexEntry * | findTimeStampEntryInIndex (int64_t wantedTimeStamp, int32_t flags) |
| Search for the given time stamp in the key-frame index for this IStream. More... | |
| virtual int32_t | findTimeStampPositionInIndex (int64_t wantedTimeStamp, int32_t flags) |
| Search for the given time stamp in the key-frame index for this IStream. More... | |
| virtual IIndexEntry * | getIndexEntry (int32_t position) |
| Get the IIndexEntry at the given position in this IStream object's index. More... | |
| virtual int32_t | addIndexEntry (IIndexEntry *entry) |
| Adds an index entry into the stream's sorted index list. More... | |
| void | setId (int32_t id) |
| Set the format-specific stream id. More... | |
Public Member Functions inherited from com::avpkit::ferry::RefCounted | |
| 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 Stream * | make (Container *container, AVStream *, Direction direction, const AVCodec *) |
Additional Inherited Members | |
Public Types inherited from com::avpkit::core::IStream | |
| enum | Direction { INBOUND , OUTBOUND } |
| The direction this stream is going (based on the container). More... | |
| enum | ParseType { PARSE_NONE , PARSE_FULL , PARSE_HEADERS , PARSE_TIMESTAMPS , PARSE_FULL_ONCE , PARSE_FULL_RAW } |
| What types of parsing can we do on a call to IContainer#readNextPacket(IPacket). More... | |
| typedef enum com::avpkit::core::IStream::Direction | Direction |
| The direction this stream is going (based on the container). More... | |
| typedef enum com::avpkit::core::IStream::ParseType | ParseType |
| What types of parsing can we do on a call to IContainer#readNextPacket(IPacket). | |
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 |
Internal Only.
DO NOT USE FROM JAVA.
Acquire a reference to this object. This increments the native internal ref count in native code by +1.
This method is called internally by Ferry in Java, and you should not call it without knowing what you are doing. But if you do call it, make sure you call release() once for each call you make to this method.
Reimplemented from com::avpkit::ferry::RefCounted.
Definition at line 204 of file Stream.cpp.
References com::avpkit::ferry::RefCounted::acquire().
|
virtual |
Adds an index entry into the stream's sorted index list.
Updates the entry if the list already contains it.
| entry | The entry to add. |
Implements com::avpkit::core::IStream.
Definition at line 507 of file Stream.cpp.
References com::avpkit::core::IIndexEntry::getFlags(), com::avpkit::core::IIndexEntry::getMinDistance(), com::avpkit::core::IIndexEntry::getPosition(), com::avpkit::core::IIndexEntry::getSize(), and com::avpkit::core::IIndexEntry::getTimeStamp().
|
virtual |
Search for the given time stamp in the key-frame index for this IStream.
Not all IContainerFormat implementations maintain key frame indexes, but if they have one, then this method searches in the IStream index to quickly find the byte-offset of the nearest key-frame to the given time stamp.
| wantedTimeStamp | the time stamp wanted, in the stream's time base units. |
| flags | A bitmask of the SEEK_FLAG_* flags, or 0 to turn all flags off. If IContainer#SEEK_FLAG_BACKWARDS then the returned index will correspond to the time stamp which is <= the requested one (not supported by all demuxers). If IContainer#SEEK_FLAG_BACKWARDS is not set then it will be >=. if IContainer#SEEK_FLAG_ANY seek to any frame, only keyframes otherwise (not supported by all demuxers). |
Implements com::avpkit::core::IStream.
Definition at line 465 of file Stream.cpp.
References findTimeStampPositionInIndex(), and getIndexEntry().
|
virtual |
Search for the given time stamp in the key-frame index for this IStream.
Not all IContainerFormat implementations maintain key frame indexes, but if they have one, then this method searches in the IStream index to quickly find the index entry position of the nearest key-frame to the given time stamp.
| wantedTimeStamp | the time stamp wanted, in the stream's time base units. |
| flags | A bitmask of the SEEK_FLAG_* flags, or 0 to turn all flags off. If IContainer#SEEK_FLAG_BACKWARDS then the returned index will correspond to the time stamp which is <= the requested one (not supported by all demuxers). If IContainer#SEEK_FLAG_BACKWARDS is not set then it will be >=. if IContainer#SEEK_FLAG_ANY seek to any frame, only keyframes otherwise (not supported by all demuxers). |
Implements com::avpkit::core::IStream.
Definition at line 472 of file Stream.cpp.
Referenced by findTimeStampEntryInIndex().
|
virtual |
Get the underlying container for this stream, or null if AVPKit doesn't know.
Implements com::avpkit::core::IStream.
Definition at line 269 of file Stream.cpp.
|
virtual |
The current Decompression Time Stamp that will be used on this stream, in getTimeBase() units.
Implements com::avpkit::core::IStream.
Definition at line 178 of file Stream.cpp.
References com::avpkit::core::Global::NO_PTS.
|
inlinevirtual |
Get the Direction this stream is pointing in.
Implements com::avpkit::core::IStream.
|
virtual |
Return the duration, in getTimeBase() units, of this stream, or Global#NO_PTS if unknown.
Implements com::avpkit::core::IStream.
Definition at line 172 of file Stream.cpp.
References com::avpkit::core::Global::NO_PTS.
|
virtual |
Get the (sometimes estimated) frame rate of this container.
For variable frame-rate containers (they do exist) this is just an approimation. Better to use getTimeBase().
For contant frame-rate containers, this will be 1 / ( getTimeBase() )
Implements com::avpkit::core::IStream.
Definition at line 125 of file Stream.cpp.
References com::avpkit::core::IRational::make().
|
virtual |
Return a container format specific id for this stream.
Implements com::avpkit::core::IStream.
Definition at line 107 of file Stream.cpp.
|
virtual |
Get the relative position this stream has in the hosting IContainer object.
Implements com::avpkit::core::IStream.
Definition at line 101 of file Stream.cpp.
Referenced by stampOutputPacket().
|
virtual |
Get the IIndexEntry at the given position in this IStream object's index.
Not all IContainerFormat types maintain IStream indexes, but if they do, this method can return those entries.
Do not modify the IContainer this stream is from between calls to this method and getNumIndexEntries() as indexes may be compacted while processing.
| position | The position in the index table. |
Implements com::avpkit::core::IStream.
Definition at line 486 of file Stream.cpp.
References com::avpkit::core::IIndexEntry::make().
Referenced by findTimeStampEntryInIndex().
|
virtual |
Get the 4-character language setting for this stream.
This will return null if no setting. When calling from C++, callers must ensure that the IStream outlives the value returned.
Implements com::avpkit::core::IStream.
Definition at line 248 of file Stream.cpp.
References getMetaData(), and com::avpkit::core::IMetaData::METADATA_NONE.
|
virtual |
Get the IMetaData for this object, or null if none.
If the IContainer or IStream object that this IMetaData came from was opened for reading, then changes via IMetaData#setValue(String, String) will have no effect on the underlying media.
If the IContainer or IStream object that this IMetaData came from was opened for writing, then changes via IMetaData#setValue(String, String) will have no effect after IContainer#writeHeader() is called.
Implements com::avpkit::core::IStream.
Definition at line 368 of file Stream.cpp.
References com::avpkit::core::IMetaData::make().
Referenced by getLanguage(), setLanguage(), and setMetaData().
|
virtual |
Returns the number of encoded frames if known.
Note that frames here means encoded frames, which can consist of many encoded audio samples, or an encoded video frame.
Implements com::avpkit::core::IStream.
Definition at line 184 of file Stream.cpp.
|
virtual |
Get the number of index entries in this stream.
Implements com::avpkit::core::IStream.
Definition at line 189 of file Stream.cpp.
|
virtual |
Get how the decoding codec should parse data from this stream.
Implements com::avpkit::core::IStream.
Definition at line 320 of file Stream.cpp.
|
virtual |
Added in 1.17.
Gets the sample aspect ratio.
Implements com::avpkit::core::IStream.
Definition at line 222 of file Stream.cpp.
References com::avpkit::core::IRational::make().
|
virtual |
Return the start time, in getTimeBase() units, when this stream started.
Implements com::avpkit::core::IStream.
Definition at line 166 of file Stream.cpp.
References com::avpkit::core::Global::NO_PTS.
|
virtual |
Get the StreamCoder than can manipulate this stream.
If the stream is an INBOUND stream, then the StreamCoder can do a IStreamCoder::DECODE. IF this stream is an OUTBOUND stream, then the StreamCoder can do all IStreamCoder::ENCODE methods.
Implements com::avpkit::core::IStream.
Definition at line 113 of file Stream.cpp.
|
virtual |
The time base in which all timestamps (e.g.
Presentation Time Stamp (PTS) and Decompression Time Stamp (DTS)) are represented. For example if the time base is 1/1000, then the difference between a PTS of 1 and a PTS of 2 is 1 millisecond. If the timebase is 1/1, then the difference between a PTS of 1 and a PTS of 2 is 1 second.
Implements com::avpkit::core::IStream.
Definition at line 137 of file Stream.cpp.
References com::avpkit::core::IRational::make().
Referenced by stampOutputPacket().
|
virtual |
Internal Only.
DO NOT USE FROM JAVA.
This decrements the native internal ref count by -1; the object is destroyed if its ref count reaches zero.
This method is called internally by Ferry in Java, and you should not call it without knowing what you are doing. But if you do call it, make sure you had previously called acquire() once for each call to release() you make.
Reimplemented from com::avpkit::ferry::RefCounted.
Definition at line 213 of file Stream.cpp.
References com::avpkit::ferry::RefCounted::release().
|
virtual |
Set a bitstream filter on this stream.
| name | The name of bitstream filter |
Implements com::avpkit::core::IStream.
Definition at line 338 of file Stream.cpp.
|
virtual |
Set the format-specific stream id.
| id | The id to set. |
Implements com::avpkit::core::IStream.
Definition at line 522 of file Stream.cpp.
Referenced by com::avpkit::core::Container::addNewStream().
|
virtual |
Set the 4-character language setting for this stream.
If a string longer than 4 characters is passed in, only the first 4 characters is copied.
| language | The new language setting. null is equivalent to the empty string. strings longer than 4 characters will be truncated to first 4 characters. |
Implements com::avpkit::core::IStream.
Definition at line 259 of file Stream.cpp.
References getMetaData().
|
virtual |
Set the IMetaData on this object, overriding any previous meta data.
You should call this method on writable containers and before you call IContainer#writeHeader, as it probably won't do anything after that.
Implements com::avpkit::core::IStream.
Definition at line 383 of file Stream.cpp.
References com::avpkit::core::MetaData::copy(), getMetaData(), and com::avpkit::ferry::RefCounted::release().
|
virtual |
Set the parse type the decoding codec should use.
Set to ParseType#PARSE_NONE if you don't want any parsing to be done.
Warning: do not set this flag unless you know what you're doing, and do not set after you've started decoding.
| type | The type to set. |
Implements com::avpkit::core::IStream.
Definition at line 330 of file Stream.cpp.
|
virtual |
Sets the sample aspect ratio.
| newRatio | The new ratio. |
Implements com::avpkit::core::IStream.
Definition at line 235 of file Stream.cpp.
References com::avpkit::core::IRational::getDenominator(), and com::avpkit::core::IRational::getNumerator().
|
virtual |
Sets the stream coder to use for this stream.
This method will only cause a change if the IStreamCoder currently set on this IStream is not open. Otherwise the call is ignore and an error is returned.
| newCoder | The new stream coder to use. |
Implements com::avpkit::core::IStream.
Definition at line 277 of file Stream.cpp.
Referenced by com::avpkit::core::Container::addNewStream().
|
virtual |
Sets the stream coder to use for this stream.
This method will only cause a change if the IStreamCoder currently set on this IStream is not open. Otherwise the call is ignored and an error is returned.
| newCoder | The new stream coder to use. |
| assumeOnlyStream | If true then this IStream will notify the IStreamCoder that it is the only stream and the IStreamCoder may use it to determine time stamps to output packets with. If false then the IStreamCoder does not support automatic stamping of packets with stream index IDs and users must call stampOutputPacket(IPacket) themselves. |
Implements com::avpkit::core::IStream.
Definition at line 282 of file Stream.cpp.
References com::avpkit::core::StreamCoder::isOpen().
|
virtual |
Takes a packet destined for this stream, and stamps the stream index, and converts the time stamp to the correct units (adjusting for rounding errors between stream conversions).
| packet | to stamp |
Implements com::avpkit::core::IStream.
Definition at line 395 of file Stream.cpp.
References com::avpkit::core::IPacket::getDts(), com::avpkit::core::IPacket::getDuration(), getIndex(), com::avpkit::core::IPacket::getPts(), getTimeBase(), com::avpkit::core::IMediaData::getTimeBase(), com::avpkit::core::Global::NO_PTS, com::avpkit::core::IPacket::setDts(), com::avpkit::core::IPacket::setDuration(), com::avpkit::core::IPacket::setPts(), com::avpkit::core::IPacket::setStreamIndex(), com::avpkit::core::IMediaData::setTimeBase(), and com::avpkit::ferry::RefPointer< T >::value().
Referenced by com::avpkit::core::Container::writePacket().