|
AVPKit
|


Public Member Functions | |
| virtual int32_t | setInputBufferLength (int32_t size) |
| Set the buffer length AVPKit will suggest to FFMPEG for reading inputs. More... | |
| virtual int32_t | getInputBufferLength () |
| Return the input buffer length. More... | |
| virtual bool | isOpened () |
| Is this container opened? More... | |
| virtual bool | isHeaderWritten () |
| Has a header been successfully written? More... | |
| virtual int32_t | open (const char *url, Type type, IContainerFormat *pContainerFormat) |
| Open this container and make it ready for reading or writing. More... | |
| virtual int32_t | open (const char *url, Type type, IContainerFormat *pContainerFormat, bool, bool) |
| Open this container and make it ready for reading or writing, optionally reading as far into the container as necessary to find all streams. More... | |
| virtual IStreamCoder::CodecStandardsCompliance | getStandardsCompliance () |
| Gets the current level of standards compliance. More... | |
| virtual int32_t | setStandardsCompliance (IStreamCoder::CodecStandardsCompliance compliance) |
| Set the level of standards compliance. More... | |
| virtual IContainerFormat * | getContainerFormat () |
| Returns the IContainerFormat object being used for this IContainer, or null if the IContainer doesn't yet know. More... | |
| virtual Type | getType () |
| Find out the type of this container. More... | |
| virtual int32_t | close () |
| virtual int32_t | close (bool) |
| Close the container. More... | |
| virtual int32_t | getNumStreams () |
| The number of streams in this container. More... | |
| virtual Stream * | getStream (int32_t position) |
| Get the stream at the given position. More... | |
| virtual Stream * | addNewStream (int32_t id) |
| virtual int32_t | readNextPacket (IPacket *packet) |
| Reads the next packet into the IPacket. More... | |
| virtual int32_t | writePacket (IPacket *packet, bool forceInterleave) |
| Writes the contents of the packet to the container. More... | |
| virtual int32_t | writePacket (IPacket *packet) |
| Writes the contents of the packet to the container, but make sure the packets are interleaved. More... | |
| virtual int32_t | writeHeader () |
| Adds a header, if needed, for this container. More... | |
| virtual int32_t | writeTrailer () |
| Adds a trailer, if needed, for this container. More... | |
| AVFormatContext * | getFormatContext () |
| virtual int32_t | queryStreamMetaData () |
| Attempts to read all the meta data in this stream, potentially by reading ahead and decoding packets. More... | |
| virtual int32_t | seekKeyFrame (int streamIndex, int64_t timestamp, int32_t flags) |
| virtual int64_t | getDuration () |
| Gets the duration, if known, of this container. More... | |
| virtual int64_t | getStartTime () |
| Get the starting timestamp in microseconds of the first packet of the earliest stream in this container. More... | |
| virtual int64_t | getFileSize () |
| Get the file size in bytes of this container. More... | |
| virtual int32_t | getBitRate () |
| Get the calculated overall bit rate of this file. More... | |
| virtual int32_t | setPreload (int32_t preload) |
| @Deprecated use setProperty instead. More... | |
| virtual int32_t | getPreload () |
| @Deprecated use getPropertyAsLong instead. More... | |
| virtual int32_t | setMaxDelay (int32_t maxdelay) |
| Sets the max delay for the AVFormatContext.max_delay property. More... | |
| virtual int32_t | getMaxDelay () |
| Gets the AVFormatContext.max_delay property if possible. More... | |
| virtual int32_t | getNumProperties () |
| Returns the total number of settable properties on this object. More... | |
| virtual IProperty * | getPropertyMetaData (int32_t propertyNo) |
| Returns the name of the numbered property. More... | |
| virtual IProperty * | getPropertyMetaData (const char *name) |
| Returns the name of the numbered property. More... | |
| virtual int32_t | setProperty (const char *name, const char *value) |
| Sets a property on this Object. More... | |
| virtual int32_t | setProperty (const char *name, double value) |
| Looks up the property 'name' and sets the value of the property to 'value'. More... | |
| virtual int32_t | setProperty (const char *name, int64_t value) |
| Looks up the property 'name' and sets the value of the property to 'value'. More... | |
| virtual int32_t | setProperty (const char *name, bool value) |
| Looks up the property 'name' and sets the value of the property to 'value'. More... | |
| virtual int32_t | setProperty (const char *name, IRational *value) |
| Looks up the property 'name' and sets the value of the property to 'value'. More... | |
| virtual char * | getPropertyAsString (const char *name) |
| Gets a property on this Object. More... | |
| virtual double | getPropertyAsDouble (const char *name) |
| Gets the value of this property, and returns as a double;. More... | |
| virtual int64_t | getPropertyAsLong (const char *name) |
| Gets the value of this property, and returns as an long;. More... | |
| virtual IRational * | getPropertyAsRational (const char *name) |
| Gets the value of this property, and returns as an IRational;. More... | |
| virtual bool | getPropertyAsBoolean (const char *name) |
| Gets the value of this property, and returns as a boolean. More... | |
| virtual int32_t | getFlags () |
| Get the flags associated with this object. More... | |
| virtual void | setFlags (int32_t newFlags) |
| Set the flags to use with this object. More... | |
| virtual bool | getFlag (Flags flag) |
| Get the setting for the specified flag. More... | |
| virtual void | setFlag (Flags flag, bool value) |
| Set the flag. More... | |
| virtual const char * | getURL () |
| Get the URL the IContainer was opened with. More... | |
| virtual int32_t | flushPackets () |
| Flush all packets to output. More... | |
| virtual int32_t | getReadRetryCount () |
| Get the number of times IContainer#readNextPacket(IPacket) will retry a read if it gets a IError.Type#ERROR_AGAIN value back. More... | |
| virtual void | setReadRetryCount (int32_t count) |
| Sets the read retry count. More... | |
| virtual bool | canStreamsBeAddedDynamically () |
| Can streams be added dynamically to this container? More... | |
| 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 | createSDPData (com::avpkit::ferry::IBuffer *buffer) |
| Fills the given buffer with a null-terminated ASCII set of bytes representing SDP data that is suitable for use with an RTSP-based system. More... | |
| virtual int32_t | setForcedAudioCodec (ICodec::ID id) |
| Forces the IContainer to assume all audio streams are encoded with the given audio codec when demuxing. More... | |
| virtual int32_t | setForcedVideoCodec (ICodec::ID id) |
| Forces the IContainer to assume all video streams are encoded with the given video codec when demuxing. More... | |
| virtual int32_t | setForcedSubtitleCodec (ICodec::ID id) |
| Forces the IContainer to assume all subtitle streams are encoded with the given subtitle codec when demuxing. More... | |
| virtual int32_t | seekKeyFrame (int32_t streamIndex, int64_t minTimeStamp, int64_t targetTimeStamp, int64_t maxTimeStamp, int32_t flags) |
| EXPERIMENTAL - Seeks to timestamp in the container. More... | |
| virtual Stream * | addNewStream (ICodec::ID id) |
| Add a new stream that will use the given codec. More... | |
| virtual Stream * | addNewStream (ICodec *codec) |
| Add a new stream that will use the given codec. More... | |
| virtual Stream * | addNewStream (IStreamCoder *coder) |
| Add a new stream that will use the given StreamCoder. More... | |
| virtual ContainerFormat * | getFormat () |
| Get the IContainerFormat that is used by this IContainer. More... | |
| virtual int32_t | setFormat (IContainerFormat *format) |
| Set the IContainerFormat to use with this IContainer. More... | |
| virtual int32_t | setProperty (IMetaData *valuesToSet, IMetaData *valuesNotFound) |
| virtual int32_t | open (const char *url, Type type, IContainerFormat *pContainerFormat, bool, bool, IMetaData *, IMetaData *) |
| Open this container and make it ready for reading or writing, optionally reading as far into the container as necessary to find all streams. More... | |
| int32_t | setCustomIOProtocol (io::URLProtocolHandlerFactory *factory) |
Public Member Functions inherited from com::avpkit::core::IContainer | |
| virtual int32_t | seekKeyFrame (int32_t streamIndex, int64_t timestamp, int32_t flags)=0 |
| Seeks to the key frame at (or the first one after) the given timestamp. More... | |
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 Container * | make (IContainerFormat *format) |
Static Public Member Functions inherited from com::avpkit::core::IContainer | |
| static IContainer * | make () |
| Create a new container object. More... | |
| static IContainer * | make (IContainerFormat *format) |
| Create a new IContainer and call setFormat(IContainerFormat) on it immediately. More... | |
Additional Inherited Members | |
Public Types inherited from com::avpkit::core::IContainer | |
| enum | Type { READ , WRITE } |
| The different types of Containers AVPKit supports. More... | |
| enum | Flags { FLAG_GENPTS =0x0001 , FLAG_IGNIDX =0x0002 , FLAG_NONBLOCK =0x0004 , FLAG_IGNDTS =0x0008 , FLAG_NOFILLIN =0x0010 , FLAG_NOPARSE =0x0020 , FLAG_NOBUFFER =0x0040 , FLAG_CUSTOM_IO =0x0080 , FLAG_DISCARD_CORRUPT =0x0100 , FLAG_FLUSH_PACKETS =0x0200 , FLAG_BITEXACT =0x0400 , FLAG_MP4A_LATM =0x8000 , FLAG_SORT_DTS =0x10000 , FLAG_PRIV_OPT =0x20000 , FLAG_KEEP_SIDE_DATA =0x40000 , FLAG_FAST_SEEK =0x80000 , FLAG_SHORTEST =0x100000 , FLAG_AUTO_BSF =0x200000 } |
| typedef enum com::avpkit::core::IContainer::Type | Type |
| The different types of Containers AVPKit supports. More... | |
| typedef enum com::avpkit::core::IContainer::Flags | Flags |
Static Public Attributes inherited from com::avpkit::core::IContainer | |
| static const int32_t | SEEK_FLAG_BACKWARDS =1 |
| Flag; Seek backwards. | |
| static const int32_t | SEEK_FLAG_BYTE =2 |
| Flag; Use bytes instead of time stamps for seeking. | |
| static const int32_t | SEEK_FLAG_ANY =4 |
| Flag; Seek to any frame, even non-keyframes. | |
| static const int32_t | SEEK_FLAG_FRAME =8 |
| Flag; Seek based on frame number instead of time stamps. | |
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. | |
Definition at line 40 of file Container.h.
Add a new stream that will use the given codec.
| codec | The codec that will be used to insert packets. |
Implements com::avpkit::core::IContainer.
Definition at line 1508 of file Container.cpp.
References com::avpkit::ferry::RefPointer< T >::get().
|
virtual |
Add a new stream that will use the given codec.
| id | The id for the codec used to insert packets. If you are adding an arbitrary data stream, use ICodec.ID#AV_CODEC_ID_NONE, otherwise use the ID of the code type you plan to use. |
Implements com::avpkit::core::IContainer.
Definition at line 1485 of file Container.cpp.
References com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Creates a new stream in this container and returns it.
| id | A format-dependent id for this stream. |
Implements com::avpkit::core::IContainer.
Definition at line 1587 of file Container.cpp.
References com::avpkit::core::Stream::setId().
|
virtual |
Add a new stream that will use the given StreamCoder.
The StreamCoder passed in MUST contain the IStreamCoder#getExtraData that was used to encode the packet.
| coder | The IStreamCoder that contains the meta-information needed for decoding the packets that will be muexed into this stream. |
Implements com::avpkit::core::IContainer.
Definition at line 1558 of file Container.cpp.
References com::avpkit::core::StreamCoder::getCodec(), com::avpkit::core::Stream::setStreamCoder(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Can streams be added dynamically to this container?
Implements com::avpkit::core::IContainer.
Definition at line 1379 of file Container.cpp.
|
virtual |
Close the container.
open() must have been called first, or else an error is returned.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
If this method exits because of an interruption, all resources will be closed anyway.
Implements com::avpkit::core::IContainer.
Definition at line 649 of file Container.cpp.
|
virtual |
Fills the given buffer with a null-terminated ASCII set of bytes representing SDP data that is suitable for use with an RTSP-based system.
This method only works if AVPKit is linking against a version of FFmpeg that supports RTSP.
| buffer | the com.avpkit.ferry.IBuffer object to fill with data. |
Implements com::avpkit::core::IContainer.
Definition at line 1413 of file Container.cpp.
References com::avpkit::ferry::IBuffer::getBufferSize(), and com::avpkit::ferry::IBuffer::getBytes().
|
virtual |
Flush all packets to output.
Will only work on IContainer.Type#WRITE containers.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
Implements com::avpkit::core::IContainer.
Definition at line 1299 of file Container.cpp.
|
virtual |
Get the calculated overall bit rate of this file.
This will only return a valid value if the container is non-streamed and supports seek.
Implements com::avpkit::core::IContainer.
Definition at line 1113 of file Container.cpp.
|
virtual |
Returns the IContainerFormat object being used for this IContainer, or null if the IContainer doesn't yet know.
Implements com::avpkit::core::IContainer.
Definition at line 405 of file Container.cpp.
References com::avpkit::core::ContainerFormat::setInputFormat(), and com::avpkit::core::ContainerFormat::setOutputFormat().
|
virtual |
Gets the duration, if known, of this container.
This will only work for non-streamable containers where IContainer can calculate the container size.
Implements com::avpkit::core::IContainer.
Definition at line 1077 of file Container.cpp.
|
virtual |
Get the file size in bytes of this container.
This will only return a valid value if the container is non-streamed and supports seek.
Implements com::avpkit::core::IContainer.
Definition at line 1097 of file Container.cpp.
|
virtual |
Get the setting for the specified flag.
| flag | The flag you want to find the setting for |
Implements com::avpkit::core::IContainer.
Definition at line 1267 of file Container.cpp.
|
virtual |
Get the flags associated with this object.
Implements com::avpkit::core::IContainer.
Definition at line 1248 of file Container.cpp.
|
inlinevirtual |
Get the IContainerFormat that is used by this IContainer.
Implements com::avpkit::core::IContainer.
Definition at line 141 of file Container.h.
|
virtual |
Return the input buffer length.
Implements com::avpkit::core::IContainer.
Definition at line 252 of file Container.cpp.
|
virtual |
Gets the AVFormatContext.max_delay property if possible.
Implements com::avpkit::core::IContainer.
Definition at line 1153 of file Container.cpp.
|
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::IContainer.
Definition at line 1387 of file Container.cpp.
|
virtual |
Returns the total number of settable properties on this object.
Implements com::avpkit::core::IContainer.
Definition at line 1162 of file Container.cpp.
|
virtual |
The number of streams in this container.
If opened in IContainer.Type#READ mode, this will query the stream and find out how many streams are in it.
If opened in IContainer.Type#WRITE mode, this will return the number of streams the caller has added to date.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
Implements com::avpkit::core::IContainer.
Definition at line 629 of file Container.cpp.
|
virtual |
@Deprecated use getPropertyAsLong instead.
The amount container will attemtp to preload.
Implements com::avpkit::core::IContainer.
Definition at line 1130 of file Container.cpp.
|
virtual |
Gets the value of this property, and returns as a boolean.
| name | name of option |
Implements com::avpkit::core::IContainer.
Definition at line 1242 of file Container.cpp.
|
virtual |
Gets the value of this property, and returns as a double;.
| name | name of option |
Implements com::avpkit::core::IContainer.
Definition at line 1224 of file Container.cpp.
|
virtual |
Gets the value of this property, and returns as an long;.
| name | name of option |
Implements com::avpkit::core::IContainer.
Definition at line 1230 of file Container.cpp.
|
virtual |
Gets the value of this property, and returns as an IRational;.
| name | name of option |
Implements com::avpkit::core::IContainer.
Definition at line 1236 of file Container.cpp.
|
virtual |
Gets a property on this Object.
Note for C++ callers; you must free the returned array with delete[] in order to avoid a memory leak. If you call from Java or any other language, you don't need to worry about this.
| name | property name |
Implements com::avpkit::core::IContainer.
Definition at line 1218 of file Container.cpp.
|
virtual |
Returns the name of the numbered property.
| name | The property name. |
Implements com::avpkit::core::IContainer.
Definition at line 1174 of file Container.cpp.
|
virtual |
Returns the name of the numbered property.
| propertyNo | The property number in the options list. |
Implements com::avpkit::core::IContainer.
Definition at line 1168 of file Container.cpp.
|
virtual |
Get the number of times IContainer#readNextPacket(IPacket) will retry a read if it gets a IError.Type#ERROR_AGAIN value back.
Defaults to 1 times. <0 means it will keep retrying indefinitely.
Implements com::avpkit::core::IContainer.
Definition at line 1326 of file Container.cpp.
|
virtual |
Gets the current level of standards compliance.
Implements com::avpkit::core::IContainer.
Definition at line 387 of file Container.cpp.
|
virtual |
Get the starting timestamp in microseconds of the first packet of the earliest stream in this container.
This will only return value values either either (a) for non-streamable containers where IContainer can calculate the container size or (b) after IContainer has actually read the first packet from a streamable source.
Implements com::avpkit::core::IContainer.
Definition at line 1087 of file Container.cpp.
|
virtual |
Get the stream at the given position.
| streamIndex | the index of this stream in the container |
Implements com::avpkit::core::IContainer.
Definition at line 714 of file Container.cpp.
|
virtual |
Find out the type of this container.
Implements com::avpkit::core::IContainer.
Definition at line 622 of file Container.cpp.
|
virtual |
Get the URL the IContainer was opened with.
May return null if unknown.
Implements com::avpkit::core::IContainer.
Definition at line 1293 of file Container.cpp.
|
virtual |
Has a header been successfully written?
Implements com::avpkit::core::IContainer.
Definition at line 264 of file Container.cpp.
|
virtual |
Is this container opened?
Implements com::avpkit::core::IContainer.
Definition at line 258 of file Container.cpp.
|
virtual |
Open this container and make it ready for reading or writing.
The caller must call close() when done, but if not, the IContainer will eventually close them later but warn to the logging system.
This just forwards to open(String, Type, IContainerFormat, boolean, boolean) passing false for aStreamsCanBeAddedDynamically, and true for aLookForAllStreams.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| url | The resource to open; The format of this string is any url that FFMPEG supports (including additional protocols if added through the core.io library). |
| type | The type of this container. |
| pContainerFormat | A pointer to a ContainerFormat object specifying the format of this container, or 0 (NULL) if you want us to guess. |
Implements com::avpkit::core::IContainer.
Definition at line 270 of file Container.cpp.
|
virtual |
Open this container and make it ready for reading or writing, optionally reading as far into the container as necessary to find all streams.
The caller must call close() when done, but if not, the IContainer will eventually close them later but warn to the logging system.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| url | The resource to open; The format of this string is any url that FFMPEG supports (including additional protocols if added through the core.io library). |
| type | The type of this container. |
| pContainerFormat | A pointer to a ContainerFormat object specifying the format of this container, or 0 (NULL) if you want us to guess. |
| aStreamsCanBeAddedDynamically | If true, open() will expect that new streams can be added at any time, even after the format header has been read. |
| aQueryStreamMetaData | If true, open() will call queryStreamMetaData() on this container, which will potentially block until it has ready enough data to find all streams in a container. If false, it will only block to read a minimal header for this container format. |
Implements com::avpkit::core::IContainer.
Definition at line 277 of file Container.cpp.
|
virtual |
Open this container and make it ready for reading or writing, optionally reading as far into the container as necessary to find all streams.
The caller must call close() when done, but if not, the IContainer will eventually close them later but warn to the logging system.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| url | The resource to open; The format of this string is any url that FFMPEG supports (including additional protocols if added through the core.io library). |
| type | The type of this container. |
| containerFormat | A pointer to a ContainerFormat object specifying the format of this container, or 0 (NULL) if you want us to guess. |
| streamsCanBeAddedDynamically | If true, open() will expect that new streams can be added at any time, even after the format header has been read. |
| queryStreamMetaData | If true, open() will call queryStreamMetaData() on this container, which will potentially block until it has ready enough data to find all streams in a container. If false, it will only block to read a minimal header for this container format. |
| options | If not null, a set of key-value pairs that will be set on the container immediately the format is determined. Some options cannot be set (especially for input containers) until the system has a chance to parse what data is in the file. |
| optionsNotSet | If not null, on return this IMetaData object will be cleared out, and replace with any key/value pairs that were in options but could not be set on this IContainer. |
Implements com::avpkit::core::IContainer.
Definition at line 287 of file Container.cpp.
References com::avpkit::core::MetaData::copy(), and com::avpkit::core::MetaData::getDictionary().
|
virtual |
Attempts to read all the meta data in this stream, potentially by reading ahead and decoding packets.
Any packets this method reads ahead will be cached and correctly returned when you read packets, but this method can be non-blocking potentially until end of container to get all meta data. Take care when you call it.
After this method is called, other meta data methods like getDuration() should work.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
Implements com::avpkit::core::IContainer.
Definition at line 999 of file Container.cpp.
|
virtual |
Reads the next packet into the IPacket.
This method will release any buffers currently held by this packet and allocate new ones.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| packet | [In/Out] The packet the IContainer will read into. |
Implements com::avpkit::core::IContainer.
Definition at line 732 of file Container.cpp.
References com::avpkit::core::Packet::getDts(), com::avpkit::core::Packet::getDuration(), com::avpkit::core::Packet::getFlags(), com::avpkit::core::Packet::getPosition(), com::avpkit::core::Packet::getPts(), com::avpkit::core::Packet::getSize(), com::avpkit::core::Packet::getStreamIndex(), com::avpkit::core::Packet::setTimeBase(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
EXPERIMENTAL - Seeks to timestamp in the container.
Seeking will be done so that the point from which all active streams can be presented successfully will be closest to targetTimeStamp and within minTimeStamp/maxTimeStamp.
If flags contain SEEK_FLAG_BYTE, then all time stamps are in bytes and are the file position (this may not be supported by all demuxers). If flags contain SEEK_FLAG_FRAME, then all time stamps are in frames in the stream with streamIndex (this may not be supported by all demuxers). Otherwise all time stamps are in units of the stream selected by stream_index or if stream_index is -1, in microseconds. If flags contain SEEK_FLAG_ANY, then non-keyframes are treated as keyframes (this may not be supported by all demuxers). If flags contain SEEK_FLAG_BACKWARDS, then we will attempt to search backwards in the container (this may not be supported by all demuxers and file protocols).
This is part of the new seek API which is still under construction. It may change in future AVPKit versions.
| streamIndex | index of the stream which is used as time base reference |
| minTimeStamp | smallest acceptable time stamp. |
| targetTimeStamp | target time stamp. |
| maxTimeStamp | largest acceptable time stamp. |
| flags | A bitmask of the SEEK_FLAG_* flags, or 0 to turn all flags off. |
Implements com::avpkit::core::IContainer.
Definition at line 1051 of file Container.cpp.
|
virtual |
Set the flag.
| flag | The flag to set |
| value | The value to set it to (true or false) |
Implements com::avpkit::core::IContainer.
Definition at line 1276 of file Container.cpp.
|
virtual |
Set the flags to use with this object.
All values must be ORed (|) together.
| newFlags | The new set flags for this codec. |
Implements com::avpkit::core::IContainer.
Definition at line 1257 of file Container.cpp.
|
virtual |
Forces the IContainer to assume all audio streams are encoded with the given audio codec when demuxing.
| id | The codec id |
Implements com::avpkit::core::IContainer.
Definition at line 1446 of file Container.cpp.
|
virtual |
Forces the IContainer to assume all subtitle streams are encoded with the given subtitle codec when demuxing.
| id | The codec id |
Implements com::avpkit::core::IContainer.
Definition at line 1472 of file Container.cpp.
|
virtual |
Forces the IContainer to assume all video streams are encoded with the given video codec when demuxing.
| id | The codec id |
Implements com::avpkit::core::IContainer.
Definition at line 1459 of file Container.cpp.
|
virtual |
Set the IContainerFormat to use with this IContainer.
If called when the IContainer is opened, or if previously called with a non-null value, an error is returned and no action is taken.
| format | The format to use return 0 on success; <0 on failure |
Implements com::avpkit::core::IContainer.
Definition at line 1338 of file Container.cpp.
|
virtual |
Set the buffer length AVPKit will suggest to FFMPEG for reading inputs.
If called when a IContainer is open, the call is ignored and -1 is returned.
| size | The suggested buffer size. |
Implements com::avpkit::core::IContainer.
Definition at line 236 of file Container.cpp.
|
virtual |
Sets the max delay for the AVFormatContext.max_delay property.
| maxdelay | maximum delay for container |
Implements com::avpkit::core::IContainer.
Definition at line 1137 of file Container.cpp.
|
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::IContainer.
Definition at line 1401 of file Container.cpp.
References com::avpkit::core::MetaData::copy(), and com::avpkit::ferry::RefCounted::release().
|
virtual |
@Deprecated use setProperty instead.
If the container has not already been opened, sets the AVFormatContext.preload property which can be useful in some circumstances such as when dealing with mpeg formats.
| preload | amount to preload |
Implements com::avpkit::core::IContainer.
Definition at line 1123 of file Container.cpp.
|
virtual |
Looks up the property 'name' and sets the value of the property to 'value'.
| name | name of option |
| value | Value of option |
Implements com::avpkit::core::IContainer.
Definition at line 1204 of file Container.cpp.
|
virtual |
Sets a property on this Object.
All AVOptions supported by the underlying AVClass are supported.
| name | The property name. For example "b" for bit-rate. |
| value | The value of the property. |
Implements com::avpkit::core::IContainer.
Definition at line 1186 of file Container.cpp.
|
virtual |
Looks up the property 'name' and sets the value of the property to 'value'.
| name | name of option |
| value | Value of option |
Implements com::avpkit::core::IContainer.
Definition at line 1192 of file Container.cpp.
|
virtual |
Looks up the property 'name' and sets the value of the property to 'value'.
| name | name of option |
| value | Value of option |
Implements com::avpkit::core::IContainer.
Definition at line 1198 of file Container.cpp.
|
virtual |
Looks up the property 'name' and sets the value of the property to 'value'.
| name | name of option |
| value | Value of option |
Implements com::avpkit::core::IContainer.
Definition at line 1211 of file Container.cpp.
|
virtual |
Sets the read retry count.
| count | The read retry count. <0 means keep trying. |
Implements com::avpkit::core::IContainer.
Definition at line 1332 of file Container.cpp.
|
virtual |
Set the level of standards compliance.
Only paid attention to before the code is opened.
| compliance | The desired compliance level to set |
Implements com::avpkit::core::IContainer.
Definition at line 393 of file Container.cpp.
|
virtual |
Adds a header, if needed, for this container.
Call this AFTER you've added all streams you want to add, opened all IStreamCoders for those streams (with proper configuration) and before you write the first frame. If you attempt to write a header but haven't opened all codecs, this method will log a warning, and your output file will likely be corrupt.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
Implements com::avpkit::core::IContainer.
Definition at line 883 of file Container.cpp.
|
virtual |
Writes the contents of the packet to the container, but make sure the packets are interleaved.
This means the IContainer may have to queue up packets from one stream while waiting for packets from another.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| packet | [In] The packet to write out. |
Implements com::avpkit::core::IContainer.
Definition at line 804 of file Container.cpp.
|
virtual |
Writes the contents of the packet to the container.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
| packet | [In] The packet to write out. |
| forceInterleave | [In] If true, then this IContainer will make sure all packets are interleaved by DTS (even across streams in a container). If false, the IContainer won't, and it's up to the caller to interleave if necessary. |
Implements com::avpkit::core::IContainer.
Definition at line 809 of file Container.cpp.
References com::avpkit::core::Packet::getStreamIndex(), com::avpkit::core::Packet::isComplete(), com::avpkit::core::Stream::stampOutputPacket(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Adds a trailer, if needed, for this container.
Call this AFTER you've written all data you're going to write to this container but BEFORE you call IStreamCoder#close() on your IStreamCoder objects.
You must call writeHeader() before you call this (and if you don't, the IContainer will warn loudly and not actually write the trailer).
If you have closed any of the IStreamCoder objects that were open when you called writeHeader(), then this method will fail.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to IError#make(int) and then check IError#getType() to see if it is IError.Type#ERROR_INTERRUPTED.
Implements com::avpkit::core::IContainer.
Definition at line 952 of file Container.cpp.