23 #include <com/avpkit/ferry/RefCounted.h>
24 #include <com/avpkit/ferry/RefPointer.h>
25 #include <com/avpkit/core/IContainer.h>
26 #include <com/avpkit/core/FfmpegIncludes.h>
27 #include <com/avpkit/core/Stream.h>
28 #include <com/avpkit/core/StreamCoder.h>
29 #include <com/avpkit/core/ContainerFormat.h>
30 #include <com/avpkit/core/MetaData.h>
32 #include <com/avpkit/core/io/URLProtocolHandler.h>
36 #include <com/avpkit/core/io/URLProtocolHandlerFactory.h>
38 namespace com {
namespace avpkit {
namespace core
49 virtual int32_t
open(
const char *url,
Type type,
51 virtual int32_t
open(
const char *url,
Type type,
58 virtual int32_t close();
59 virtual int32_t close(
bool);
72 AVFormatContext *getFormatContext();
78 virtual int32_t seekKeyFrame(
int streamIndex, int64_t timestamp, int32_t flags);
95 virtual int32_t
setProperty(
const char* name,
const char* value);
96 virtual int32_t
setProperty(
const char* name,
double value);
97 virtual int32_t
setProperty(
const char* name, int64_t value);
98 virtual int32_t
setProperty(
const char* name,
bool value);
108 virtual void setFlags(int32_t newFlags);
109 virtual bool getFlag(Flags flag);
110 virtual void setFlag(Flags flag,
bool value);
112 virtual const char *
getURL();
131 virtual int32_t seekKeyFrame(int32_t streamIndex, int64_t minTimeStamp,
132 int64_t targetTimeStamp, int64_t maxTimeStamp, int32_t flags);
146 virtual int32_t
open(
const char *url,
Type type,
158 int32_t openInputURL(
const char*url,
bool,
bool, AVDictionary** options);
159 int32_t openOutputURL(
const char*url,
bool, AVDictionary **options);
160 int32_t setupAllInputStreams();
161 AVFormatContext *mFormatContext;
163 AVPacket *mBsfPacket;
172 uint32_t mNumStreams;
174 bool mNeedTrailerWrite;
179 bool mIsMetaDataQueried;
180 size_t mInputBufferLength;
182 int32_t mReadRetryCount;
virtual void setMetaData(IMetaData *metaData)
Set the IMetaData on this object, overriding any previous meta data.
virtual int32_t setForcedVideoCodec(ICodec::ID id)
Forces the IContainer to assume all video streams are encoded with the given video codec when demuxin...
virtual double getPropertyAsDouble(const char *name)
Gets the value of this property, and returns as a double;.
virtual int32_t getFlags()
Get the flags associated with this object.
virtual int32_t setProperty(const char *name, const char *value)
Sets a property on this Object.
virtual int32_t writeHeader()
Adds a header, if needed, for this container.
virtual int32_t getMaxDelay()
Gets the AVFormatContext.max_delay property if possible.
virtual IStreamCoder::CodecStandardsCompliance getStandardsCompliance()
Gets the current level of standards compliance.
virtual int32_t getNumStreams()
The number of streams in this container.
virtual void setFlag(Flags flag, bool value)
Set the flag.
virtual bool getFlag(Flags flag)
Get the setting for the specified flag.
virtual int32_t open(const char *url, Type type, IContainerFormat *pContainerFormat)
Open this container and make it ready for reading or writing.
virtual ContainerFormat * getFormat()
Get the IContainerFormat that is used by this IContainer.
virtual int32_t setForcedAudioCodec(ICodec::ID id)
Forces the IContainer to assume all audio streams are encoded with the given audio codec when demuxin...
virtual int32_t setMaxDelay(int32_t maxdelay)
Sets the max delay for the AVFormatContext.max_delay property.
virtual int64_t getDuration()
Gets the duration, if known, of this container.
virtual int32_t setFormat(IContainerFormat *format)
Set the IContainerFormat to use with this IContainer.
virtual Type getType()
Find out the type of this container.
virtual int32_t setInputBufferLength(int32_t size)
Set the buffer length AVPKit will suggest to FFMPEG for reading inputs.
virtual int32_t writeTrailer()
Adds a trailer, if needed, for this container.
virtual int32_t setPreload(int32_t preload)
@Deprecated use setProperty instead.
virtual Stream * getStream(int32_t position)
Get the stream at the given position.
virtual void setFlags(int32_t newFlags)
Set the flags to use with this object.
virtual int32_t readNextPacket(IPacket *packet)
Reads the next packet into the IPacket.
virtual int32_t writePacket(IPacket *packet, bool forceInterleave)
Writes the contents of the packet to the container.
virtual int32_t getInputBufferLength()
Return the input buffer length.
virtual int32_t getReadRetryCount()
Get the number of times IContainer#readNextPacket(IPacket) will retry a read if it gets a IError....
virtual int64_t getPropertyAsLong(const char *name)
Gets the value of this property, and returns as an long;.
virtual const char * getURL()
Get the URL the IContainer was opened with.
virtual IMetaData * getMetaData()
Get the IMetaData for this object, or null if none.
virtual int32_t getNumProperties()
Returns the total number of settable properties on this object.
virtual bool getPropertyAsBoolean(const char *name)
Gets the value of this property, and returns as a boolean.
virtual int32_t setStandardsCompliance(IStreamCoder::CodecStandardsCompliance compliance)
Set the level of standards compliance.
virtual Stream * addNewStream(int32_t id)
virtual int32_t getPreload()
@Deprecated use getPropertyAsLong instead.
virtual bool isHeaderWritten()
Has a header been successfully written?
virtual IRational * getPropertyAsRational(const char *name)
Gets the value of this property, and returns as an IRational;.
virtual int32_t setForcedSubtitleCodec(ICodec::ID id)
Forces the IContainer to assume all subtitle streams are encoded with the given subtitle codec when d...
virtual IProperty * getPropertyMetaData(int32_t propertyNo)
Returns the name of the numbered property.
virtual void setReadRetryCount(int32_t count)
Sets the read retry count.
virtual bool isOpened()
Is this container opened?
virtual char * getPropertyAsString(const char *name)
Gets a property on this Object.
virtual int64_t getFileSize()
Get the file size in bytes of this container.
virtual int32_t queryStreamMetaData()
Attempts to read all the meta data in this stream, potentially by reading ahead and decoding packets.
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 suitab...
virtual int64_t getStartTime()
Get the starting timestamp in microseconds of the first packet of the earliest stream in this contain...
virtual int32_t getBitRate()
Get the calculated overall bit rate of this file.
virtual IContainerFormat * getContainerFormat()
Returns the IContainerFormat object being used for this IContainer, or null if the IContainer doesn't...
virtual int32_t flushPackets()
Flush all packets to output.
virtual bool canStreamsBeAddedDynamically()
Can streams be added dynamically to this container?
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.
static IContainer * make()
Create a new container object.
Type
The different types of Containers AVPKit supports.
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.
A class for managing custom io protocols.
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
This class is only useful from C++.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...