23 #include <com/avpkit/ferry/RefCounted.h>
24 #include <com/avpkit/ferry/IBuffer.h>
25 #include <com/avpkit/core/AVPKit.h>
26 #include <com/avpkit/core/ICodec.h>
27 #include <com/avpkit/core/IContainerFormat.h>
28 #include <com/avpkit/core/IStream.h>
29 #include <com/avpkit/core/IStreamCoder.h>
30 #include <com/avpkit/core/IPacket.h>
31 #include <com/avpkit/core/IProperty.h>
33 namespace com {
namespace avpkit {
namespace core
203 bool aStreamsCanBeAddedDynamically,
204 bool aQueryStreamMetaData)=0;
249 virtual int32_t
close(
bool dangling=
false)=0;
467 virtual int32_t
seekKeyFrame(int32_t streamIndex, int64_t timestamp, int32_t flags)=0;
549 virtual int32_t
setProperty(
const char *name,
const char* value)=0;
597 %newobject getPropertyAsString(
const char*);
598 %typemap(newfree)
char *
"free($1);";
655 FLAG_NONBLOCK=0x0004,
657 FLAG_NOFILLIN=0x0010,
659 FLAG_NOBUFFER=0x0040,
660 FLAG_CUSTOM_IO=0x0080,
661 FLAG_DISCARD_CORRUPT=0x0100,
662 FLAG_FLUSH_PACKETS=0x0200,
663 FLAG_BITEXACT=0x0400,
664 FLAG_MP4A_LATM=0x8000,
665 FLAG_SORT_DTS=0x10000,
666 FLAG_PRIV_OPT=0x20000,
667 FLAG_KEEP_SIDE_DATA=0x40000,
668 FLAG_FAST_SEEK=0x80000,
669 FLAG_SHORTEST=0x100000,
670 FLAG_AUTO_BSF=0x200000
706 virtual void setFlag(Flags flag,
bool value) = 0;
854 static const int32_t SEEK_FLAG_BACKWARDS=1;
856 static const int32_t SEEK_FLAG_BYTE=2;
858 static const int32_t SEEK_FLAG_ANY=4;
860 static const int32_t SEEK_FLAG_FRAME=8;
896 virtual int32_t
seekKeyFrame(int32_t streamIndex, int64_t minTimeStamp,
897 int64_t targetTimeStamp, int64_t maxTimeStamp, int32_t flags)=0;
1038 bool streamsCanBeAddedDynamically,
1039 bool queryStreamMetaData,
A "key" to an IStreamCoder that tells it how to encode or decode data.
ID
These are the codecs this library currently supports.
A file (or network data source) that contains one or more IStream objects of audio and video data.
virtual int32_t setInputBufferLength(int32_t size)=0
Set the buffer length AVPKit will suggest to FFMPEG for reading inputs.
virtual int32_t getReadRetryCount()=0
Get the number of times IContainer#readNextPacket(IPacket) will retry a read if it gets a IError....
virtual double getPropertyAsDouble(const char *name)=0
Gets the value of this property, and returns as a double;.
virtual IStream * getStream(int32_t streamIndex)=0
Get the stream at the given position.
virtual IStreamCoder::CodecStandardsCompliance getStandardsCompliance()=0
Gets the current level of standards compliance.
virtual void setMetaData(IMetaData *data)=0
Set the IMetaData on this object, overriding any previous meta data.
virtual void setReadRetryCount(int32_t count)=0
Sets the read retry count.
virtual int32_t setMaxDelay(int32_t maxdelay)=0
Sets the max delay for the AVFormatContext.max_delay property.
virtual int32_t setForcedVideoCodec(ICodec::ID id)=0
Forces the IContainer to assume all video streams are encoded with the given video codec when demuxin...
virtual int32_t getNumStreams()=0
The number of streams in this container.
virtual int64_t getDuration()=0
Gets the duration, if known, of this container.
virtual int32_t writeHeader()=0
Adds a header, if needed, for this container.
virtual int32_t setForcedAudioCodec(ICodec::ID id)=0
Forces the IContainer to assume all audio streams are encoded with the given audio codec when demuxin...
virtual int64_t getPropertyAsLong(const char *name)=0
Gets the value of this property, and returns as an long;.
virtual int64_t getFileSize()=0
Get the file size in bytes of this container.
virtual IProperty * getPropertyMetaData(const char *name)=0
Returns the name of the numbered property.
virtual int32_t getPreload()=0
@Deprecated use getPropertyAsLong instead.
virtual IStream * addNewStream(int32_t id)=0
virtual IStream * addNewStream(ICodec::ID id)=0
Add a new stream that will use the given codec.
virtual int32_t setFormat(IContainerFormat *format)=0
Set the IContainerFormat to use with this IContainer.
virtual int32_t setProperty(const char *name, bool value)=0
Looks up the property 'name' and sets the value of the property to 'value'.
virtual int32_t getBitRate()=0
Get the calculated overall bit rate of this file.
virtual IStream * addNewStream(ICodec *codec)=0
Add a new stream that will use the given codec.
virtual int32_t open(const char *url, Type type, IContainerFormat *pContainerFormat)=0
Open this container and make it ready for reading or writing.
virtual int32_t setProperty(const char *name, const char *value)=0
Sets a property on this Object.
virtual void setFlags(int32_t newFlags)=0
Set the flags to use with this object.
virtual bool canStreamsBeAddedDynamically()=0
Can streams be added dynamically to this container?
virtual int32_t setProperty(const char *name, double value)=0
Looks up the property 'name' and sets the value of the property to 'value'.
virtual int32_t setPreload(int32_t preload)=0
@Deprecated use setProperty instead.
virtual Type getType()=0
Find out the type of this container.
virtual bool isOpened()=0
Is this container opened?
virtual int32_t writePacket(IPacket *packet, bool forceInterleave)=0
Writes the contents of the packet to the container.
virtual int32_t writeTrailer()=0
Adds a trailer, if needed, for this container.
virtual void setFlag(Flags flag, bool value)=0
Set the flag.
virtual IContainerFormat * getFormat()=0
Get the IContainerFormat that is used by this IContainer.
Type
The different types of Containers AVPKit supports.
virtual int32_t getNumProperties()=0
Returns the total number of settable properties on this object.
virtual int32_t open(const char *url, Type type, IContainerFormat *pContainerFormat, bool aStreamsCanBeAddedDynamically, bool aQueryStreamMetaData)=0
Open this container and make it ready for reading or writing, optionally reading as far into the cont...
virtual int32_t flushPackets()=0
Flush all packets to output.
virtual const char * getURL()=0
Get the URL the IContainer was opened with.
virtual IRational * getPropertyAsRational(const char *name)=0
Gets the value of this property, and returns as an IRational;.
virtual int32_t seekKeyFrame(int32_t streamIndex, int64_t minTimeStamp, int64_t targetTimeStamp, int64_t maxTimeStamp, int32_t flags)=0
EXPERIMENTAL - Seeks to timestamp in the container.
virtual int32_t getMaxDelay()=0
Gets the AVFormatContext.max_delay property if possible.
virtual int32_t setForcedSubtitleCodec(ICodec::ID id)=0
Forces the IContainer to assume all subtitle streams are encoded with the given subtitle codec when d...
virtual IStream * addNewStream(IStreamCoder *coder)=0
Add a new stream that will use the given StreamCoder.
virtual int32_t setProperty(const char *name, IRational *value)=0
Looks up the property 'name' and sets the value of the property to 'value'.
virtual int32_t writePacket(IPacket *packet)=0
Writes the contents of the packet to the container, but make sure the packets are interleaved.
virtual IContainerFormat * getContainerFormat()=0
Returns the IContainerFormat object being used for this IContainer, or null if the IContainer doesn't...
virtual int32_t getFlags()=0
Get the flags associated with this object.
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.
virtual int32_t queryStreamMetaData()=0
Attempts to read all the meta data in this stream, potentially by reading ahead and decoding packets.
virtual int32_t open(const char *url, Type type, IContainerFormat *containerFormat, bool streamsCanBeAddedDynamically, bool queryStreamMetaData, IMetaData *options, IMetaData *optionsNotSet)=0
Open this container and make it ready for reading or writing, optionally reading as far into the cont...
virtual bool isHeaderWritten()=0
Has a header been successfully written?
virtual bool getPropertyAsBoolean(const char *name)=0
Gets the value of this property, and returns as a boolean.
virtual int32_t close(bool dangling=false)=0
Close the container.
virtual int32_t setProperty(IMetaData *valuesToSet, IMetaData *valuesNotFound)=0
virtual int32_t getInputBufferLength()=0
Return the input buffer length.
virtual int32_t setStandardsCompliance(IStreamCoder::CodecStandardsCompliance compliance)=0
Set the level of standards compliance.
virtual IMetaData * getMetaData()=0
Get the IMetaData for this object, or null if none.
virtual int32_t setProperty(const char *name, int64_t value)=0
Looks up the property 'name' and sets the value of the property to 'value'.
virtual char * getPropertyAsString(const char *name)=0
Gets a property on this Object.
virtual int32_t readNextPacket(IPacket *packet)=0
Reads the next packet into the IPacket.
virtual bool getFlag(Flags flag)=0
Get the setting for the specified flag.
virtual int64_t getStartTime()=0
Get the starting timestamp in microseconds of the first packet of the earliest stream in this contain...
virtual IProperty * getPropertyMetaData(int32_t propertyNo)=0
Returns the name of the numbered property.
virtual int32_t createSDPData(com::avpkit::ferry::IBuffer *buffer)=0
Fills the given buffer with a null-terminated ASCII set of bytes representing SDP data that is suitab...
Represents an encoded piece of data that can be placed in an IContainer for a given IStream of data.
Represents settable properties that effect how AVPKit objects operate.
This class wraps represents a Rational number for the AVPKit.
The work horse of the AVPKit: Takes IPacket data from an IContainer (representing an IStream) and an ...
CodecStandardsCompliance
An enumeration of how strictly Codecs may follow the spec.
Represents a stream of similar data (eg video) in a IContainer.
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
Parent of all Ferry objects – it mains reference counts in native code.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...