|
AVPKit
|


Public Member Functions | |
| virtual Direction | getDirection () |
| Get the direction. More... | |
| virtual IStream * | getStream () |
| The associated Stream we're working on. More... | |
| virtual Codec * | getCodec () |
| The Codec this StreamCoder will use. More... | |
| virtual ICodec::Type | getCodecType () |
| A short hand for getCodec().getType(). More... | |
| virtual ICodec::ID | getCodecID () |
| A short hand for getCodec().getID(). More... | |
| virtual void | setCodec (ICodec *) |
| Set the Codec to the passed in Codec, discarding the old Codec if set. More... | |
| virtual void | setCodec (ICodec::ID) |
| Look up a Codec based on the passed in ID, and then set it. More... | |
| virtual void | setCodecID (ICodec::ID id) |
| Look up a Codec based on the passed in ID, and then set it. More... | |
| virtual int32_t | getBitRate () |
| The bit rate. More... | |
| virtual void | setBitRate (int32_t rate) |
| When ENCODING, sets the bit rate to use. More... | |
| virtual int32_t | getBitRateTolerance () |
| The bit rate tolerance. More... | |
| virtual void | setBitRateTolerance (int32_t tolerance) |
| When ENCODING set the bit rate tolerance. More... | |
| virtual int32_t | getHeight () |
| The height, in pixels. More... | |
| virtual void | setHeight (int32_t) |
| Set the height, in pixels. More... | |
| virtual int32_t | getWidth () |
| The width, in pixels. More... | |
| virtual void | setWidth (int32_t) |
| Set the width, in pixels. More... | |
| virtual IRational * | getTimeBase () |
| Get the time base this stream will ENCODE in, or the time base we detect while DECODING. More... | |
| virtual void | setTimeBase (IRational *newTimeBase) |
| Set the time base we'll use to ENCODE with. More... | |
| virtual IRational * | getFrameRate () |
| Get the frame-rate the attached stream claims to be using when DECODING, or the frame-rate we'll claim we're using when ENCODING. More... | |
| virtual void | setFrameRate (IRational *newFrameRate) |
| Set the frame rate we'll set in the headers of this stream while ENCODING. More... | |
| virtual int32_t | getNumPicturesInGroupOfPictures () |
| The the number of pictures in this Group of Pictures (GOP). More... | |
| virtual void | setNumPicturesInGroupOfPictures (int32_t gops) |
| Set the GOPS on this stream. More... | |
| virtual IPixelFormat::Type | getPixelType () |
| For Video streams, get the Pixel Format in use by the stream. More... | |
| virtual void | setPixelType (IPixelFormat::Type pixelFmt) |
| Set the pixel format to ENCODE with. More... | |
| virtual int32_t | getSampleRate () |
| Get the sample rate we use for this stream. More... | |
| virtual void | setSampleRate (int32_t sampleRate) |
| Set the sample rate to use when ENCODING. More... | |
| virtual int32_t | getChannels () |
| Get the number of channels in this audio stream. More... | |
| virtual void | setChannels (int32_t channels) |
| Set the number of channels to use when ENCODING. More... | |
| virtual IAudioSamples::Format | getSampleFormat () |
| Get the audio sample format. More... | |
| virtual void | setSampleFormat (IAudioSamples::Format aFormat) |
| Set the sample format when ENCODING. More... | |
| virtual int32_t | getGlobalQuality () |
| Get the Global Quality setting this codec uses for video if a VideoPicture doesn't have a quality set. More... | |
| virtual void | setGlobalQuality (int32_t newQuality) |
| Set the Global Quality to a new value. More... | |
| virtual int32_t | getFlags () |
| Get the flags associated with this codec. More... | |
| virtual void | setFlags (int32_t newFlags) |
| Set the FFMPEG flags to use with this codec. 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 int32_t | getAudioFrameSize () |
| For this stream, get the number of audio samples that are represented in a packet of information. More... | |
| virtual int32_t | open () |
| virtual int32_t | close () |
| Close a Codec that was opened on this StreamCoder. More... | |
| virtual int32_t | decodeAudio (IAudioSamples *pOutSamples, IPacket *packet, int32_t byteOffset) |
| Decode this packet into pOutSamples. More... | |
| virtual int32_t | decodeVideo (IVideoPicture *pOutFrame, IPacket *packet, int32_t byteOffset) |
| Decode this packet into pOutFrame. More... | |
| virtual int32_t | encodeVideo (IPacket *pOutPacket, IVideoPicture *pFrame, int32_t suggestedBufferSize) |
| Encode the given frame using this StreamCoder. More... | |
| virtual int32_t | encodeAudio (IPacket *pOutPacket, IAudioSamples *pSamples, int32_t sampleToStartFrom) |
| Encode the given samples using this StreamCoder. More... | |
| virtual int64_t | getNextPredictedPts () |
| For this stream, get the next Pts that we expect to decode. More... | |
| virtual int32_t | getCodecTag () |
| Returns the 4-byte FOURCC tag (Least Significant Byte first). More... | |
| virtual void | setCodecTag (int32_t) |
| Set the 4-byte FOURCC tag for this coder. 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 bool | isOpen () |
| Returns true if this IStreamCoder is currently open. More... | |
| virtual int32_t | getDefaultAudioFrameSize () |
| Get the default audio frame size (in samples). More... | |
| virtual void | setDefaultAudioFrameSize (int32_t) |
| Set the default audio frame size. More... | |
| void | setCodec (int32_t) |
| int32_t | setStream (Stream *, bool assumeOnlyStream) |
| int32_t | streamClosed (Stream *) |
| virtual int64_t | getNumDroppedFrames () |
| Get the number of frames this StreamCoder had to drop to encode at the specified getTimeBase(). More... | |
| virtual void | setAutomaticallyStampPacketsForStream (bool value) |
| Should the IStreamCoder automatically adjust time stamps on output packets for the IStream it is ultimately destined for. More... | |
| virtual bool | getAutomaticallyStampPacketsForStream () |
| Does this IStreamCoder automatically adjust time stamps on output packets for the IStream it is ultimately destined for. More... | |
| virtual int32_t | acquire () |
| Internal Only. More... | |
| virtual int32_t | release () |
| Internal Only. More... | |
| virtual int32_t | setExtraData (com::avpkit::ferry::IBuffer *src, int32_t offset, int32_t length, bool allocNew) |
| Copies data from the given buffer into the extra-data area maintained by encoders. More... | |
| virtual int32_t | getExtraData (com::avpkit::ferry::IBuffer *dest, int32_t offset, int32_t maxBytesToCopy) |
| Copies the current content of the extra-data buffer maintained by this codec (e.g. More... | |
| virtual int32_t | getExtraDataSize () |
| Gets the current number of bytes of data maintained in the coder extra-data area. More... | |
| virtual CodecStandardsCompliance | getStandardsCompliance () |
| Gets the current level of standards compliance. More... | |
| virtual int32_t | setStandardsCompliance (CodecStandardsCompliance compliance) |
| Set the level of standards compliance. More... | |
| virtual int32_t | setHardwareDecoding (IPixelFormat::Type type, void *surface=NULL) |
| Try to change current decoder to an HW decoder compatible with pixel format. More... | |
| virtual void * | getHardwareSurface () |
| virtual int32_t | open (IMetaData *options, IMetaData *unsetOptions) |
| Open the codec with the given options. More... | |
| virtual int32_t | setProperty (IMetaData *valuesToSet, IMetaData *valuesNotFound) |
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 StreamCoder * | make (Direction direction) |
| This method creates a StreamCoder that is not tied to any container or stream. | |
| static attribute_deprecated StreamCoder * | make (Direction direction, AVCodecContext *context, const AVCodec *, Stream *stream) |
| This method creates a StreamCoder that is tied to a specific stream in a container. | |
| static StreamCoder * | make (Direction direction, AVCodecParameters *codecpar, const AVCodec *, Stream *stream) |
| static StreamCoder * | make (Direction direction, IStreamCoder *copyCoder) |
| static StreamCoder * | make (Direction direction, Codec *codec) |
| static StreamCoder * | make (Direction direction, ICodec::ID id) |
Static Public Member Functions inherited from com::avpkit::core::IStreamCoder | |
| static IStreamCoder * | make (Direction direction) |
| static IStreamCoder * | make (Direction direction, IStreamCoder *copyCoder) |
| Creates a new IStreamCoder object by copying all the settings in copyCoder. More... | |
| static IStreamCoder * | make (Direction direction, ICodec *codec) |
| Create a standalone StreamCoder that can encode or decode data independent of the stream it is attached to. More... | |
| static IStreamCoder * | make (Direction direction, ICodec::ID id) |
| Create a standalone StreamCoder that can encode or decode data independent of the stream it is attached to. More... | |
Additional Inherited Members | |
Public Types inherited from com::avpkit::core::IStreamCoder | |
| enum | Direction { ENCODING , DECODING } |
| The Direction in which this StreamCoder will work. | |
| enum | Flags { FLAG_QSCALE =0x0002 , FLAG_4MV =0x0004 , FLAG_QPEL =0x0010 , FLAG_GMC =0x0020 , FLAG_MV0 =0x0040 , FLAG_INPUT_PRESERVED =0x0100 , FLAG_PASS1 =0x0200 , FLAG_PASS2 =0x0400 , FLAG_GRAY =0x2000 , FLAG_EMU_EDGE =0x4000 , FLAG_PSNR =0x8000 , FLAG_TRUNCATED =0x00010000 , FLAG_NORMALIZE_AQP =0x00020000 , FLAG_INTERLACED_DCT =0x00040000 , FLAG_LOW_DELAY =0x00080000 , FLAG_GLOBAL_HEADER =0x00400000 , FLAG_BITEXACT =0x00800000 , FLAG_AC_PRED =0x01000000 , FLAG_CBP_RD =0x04000000 , FLAG_QP_RD =0x08000000 , FLAG_LOOP_FILTER =0x00000800 , FLAG_INTERLACED_ME =0x20000000 , FLAG_CLOSED_GOP =0x80000000 , FLAG2_FAST =0x00000001 , FLAG2_STRICT_GOP =0x00000002 , FLAG2_NO_OUTPUT =0x00000004 , FLAG2_LOCAL_HEADER =0x00000008 , FLAG2_SKIP_RD =0x00004000 , FLAG2_CHUNKS =0x00008000 , FLAG2_SHOW_ALL =0x00400000 } |
| AVPKIT Flags that can be passed to the setFlag(Flags, bool) method. More... | |
| enum | CodecStandardsCompliance { COMPLIANCE_VERY_STRICT =2 , COMPLIANCE_STRICT =1 , COMPLIANCE_NORMAL =0 , COMPLIANCE_UNOFFICIAL =-1 , COMPLIANCE_EXPERIMENTAL =-2 } |
| An enumeration of how strictly Codecs may follow the spec. More... | |
| typedef enum com::avpkit::core::IStreamCoder::Direction | Direction |
| The Direction in which this StreamCoder will work. | |
| typedef enum com::avpkit::core::IStreamCoder::Flags | Flags |
| AVPKIT Flags that can be passed to the setFlag(Flags, bool) method. | |
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 34 of file StreamCoder.h.
|
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 2067 of file StreamCoder.cpp.
|
virtual |
Close a Codec that was opened on this StreamCoder.
Implements com::avpkit::core::IStreamCoder.
Definition at line 906 of file StreamCoder.cpp.
|
virtual |
Decode this packet into pOutSamples.
It will try to fill up the audio samples object, starting from the byteOffset inside this packet.
The caller is responsible for allocating the IAudioSamples object. This function will overwrite any data in the samples object.
Note that the IAudioSamples object passed in must have a IAudioSamples#getMaxBufferSize() of at least 192kbytes. Sorry, but this requirement is imposed on us via FFmpeg. If the buffer is not large enough, this method will reallocate the underlying buffers to make them at least 192kbytes.
| pOutSamples | The AudioSamples we decode to |
| packet | The packet we're attempting to decode from. |
| byteOffset | Where in the packet payload to start decoding |
Implements com::avpkit::core::IStreamCoder.
Definition at line 920 of file StreamCoder.cpp.
References com::avpkit::core::AudioSamples::ensureCapacity(), com::avpkit::core::Packet::getData(), com::avpkit::core::AudioSamples::getMaxBufferSize(), com::avpkit::core::Packet::getPts(), com::avpkit::core::Packet::getSize(), com::avpkit::core::AudioSamples::setComplete(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Decode this packet into pOutFrame.
The caller is responsible for allocating the IVideoPicture object. This function will potentially overwrite any data in the frame object, but you should pass the same IVideoPicture into this function repeatedly until IVideoPicture::isComplete() is true.
| pOutFrame | The AudioSamples we decode. |
| packet | The packet we're attempting to decode from. |
| byteOffset | Where in the packet payload to start decoding |
Implements com::avpkit::core::IStreamCoder.
Definition at line 1185 of file StreamCoder.cpp.
References com::avpkit::core::VideoPicture::copyAVFrame(), com::avpkit::core::Packet::getData(), com::avpkit::core::Packet::getSize(), com::avpkit::core::VideoPicture::setComplete(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Encode the given samples using this StreamCoder.
The VideoPicture will allocate a buffer to use internally for this, and will free it when the frame destroys itself.
Callers should call this repeatedly on a set of samples until we consume all the samples.
Also, when done in order to flush the encoder, caller should call this method passing in 0 (null) for pSamples to tell the encoder to flush any data it was keeping a hold of.
| pOutPacket | [out] The packet to encode into. It will point to a buffer allocated in the frame. Caller should check IPacket::isComplete() after call to find out if we had enough information to encode a full packet. |
| pSamples | [in] The samples to consume |
| sampleToStartFrom | [in] Which sample you want to start with This is usually zero, but if you're using a codec that packetizes output with small number of samples, you may need to call encodeAudio repeatedly with different starting samples to consume all of your samples. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 1565 of file StreamCoder.cpp.
References com::avpkit::core::Packet::allocateNewPayload(), com::avpkit::core::AudioSamples::getChannels(), com::avpkit::core::Packet::getData(), com::avpkit::core::AudioSamples::getNumSamples(), com::avpkit::core::AudioSamples::getPts(), com::avpkit::core::AudioSamples::getSampleRate(), com::avpkit::core::AudioSamples::getSampleSize(), com::avpkit::core::Packet::getSize(), com::avpkit::core::AudioSamples::getTimeStamp(), com::avpkit::core::AudioSamples::isComplete(), com::avpkit::core::Packet::reset(), com::avpkit::ferry::RefPointer< T >::reset(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
Encode the given frame using this StreamCoder.
The VideoPicture will allocate a buffer to use internally for this, and will free it when the frame destroys itself.
Also, when done in order to flush the encoder, caller should call this method passing in 0 (null) for pFrame to tell the encoder to flush any data it was keeping a hold of.
| pOutPacket | [out] The packet to encode into. It will point to a buffer allocated in the frame. Caller should check IPacket::isComplete() after call to find out if we had enough information to encode a full packet. |
| pFrame | [in/out] The frame to encode |
| suggestedBufferSize | The suggested buffer size to allocate or -1 for choose ourselves. If -1 we'll allocate a buffer exactly the same size (+1) as the decoded frame with the guess that you're encoding a frame because you want to use LESS space than that. |
@ return >= 0 on success; <0 on error.
Implements com::avpkit::core::IStreamCoder.
Definition at line 1344 of file StreamCoder.cpp.
References com::avpkit::core::Packet::allocateNewPayload(), com::avpkit::core::VideoPicture::fillAVFrame(), com::avpkit::core::Packet::getData(), com::avpkit::core::VideoPicture::getHeight(), com::avpkit::core::VideoPicture::getPixelType(), com::avpkit::core::VideoPicture::getPts(), com::avpkit::core::VideoPicture::getSize(), com::avpkit::core::VideoPicture::getWidth(), com::avpkit::core::Packet::reset(), and com::avpkit::ferry::RefPointer< T >::value().
|
virtual |
For this stream, get the number of audio samples that are represented in a packet of information.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2035 of file StreamCoder.cpp.
|
virtual |
Does this IStreamCoder automatically adjust time stamps on output packets for the IStream it is ultimately destined for.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2240 of file StreamCoder.cpp.
|
virtual |
The bit rate.
Implements com::avpkit::core::IStreamCoder.
Definition at line 511 of file StreamCoder.cpp.
|
virtual |
The bit rate tolerance.
Implements com::avpkit::core::IStreamCoder.
Definition at line 522 of file StreamCoder.cpp.
|
virtual |
Get the number of channels in this audio stream.
Implements com::avpkit::core::IStreamCoder.
Definition at line 690 of file StreamCoder.cpp.
|
virtual |
The Codec this StreamCoder will use.
Implements com::avpkit::core::IStreamCoder.
Definition at line 475 of file StreamCoder.cpp.
Referenced by com::avpkit::core::Container::addNewStream().
|
virtual |
A short hand for getCodec().getID().
Note for Native (C++) users:
If you actually write code like the above from Native code, you'd leak a Codec() since you didn't call release() on it. This method is a short hand way to avoid you having to worry about releasing in between.
Implements com::avpkit::core::IStreamCoder.
Definition at line 496 of file StreamCoder.cpp.
|
virtual |
Returns the 4-byte FOURCC tag (Least Significant Byte first).
This is really a packed 4-byte array so it's only useful if you use bit-wise operations on it. Some language wrappings may provide more obvious ways of manipulating, but this is the safest way to do this that will work with all wrappers.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2085 of file StreamCoder.cpp.
|
virtual |
A short hand for getCodec().getType().
Note for Native (C++) users:
If you actually write code like the above from Native code, you'd leak a Codec() since you didn't call release() on it. This method is a short hand way to avoid you having to worry about releasing in between.
Implements com::avpkit::core::IStreamCoder.
Definition at line 481 of file StreamCoder.cpp.
|
virtual |
Get the default audio frame size (in samples).
Some codecs, especially raw codecs, like PCM, don't have a standard frame size. In those cases, we use the value of this setting to determine how many samples to encode into a single packet.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2189 of file StreamCoder.cpp.
|
inlinevirtual |
Get the direction.
Implements com::avpkit::core::IStreamCoder.
Definition at line 43 of file StreamCoder.h.
|
virtual |
Copies the current content of the extra-data buffer maintained by this codec (e.g.
header bytes) into the dest buffer.
| dest | The buffer to copy to. |
| offset | The position, in bytes, to start writing data to in dest. |
| maxBytesToCopy | The maximum number of bytes to copy. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2281 of file StreamCoder.cpp.
References com::avpkit::ferry::IBuffer::getBytes().
|
virtual |
Gets the current number of bytes of data maintained in the coder extra-data area.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2300 of file StreamCoder.cpp.
|
virtual |
Get the setting for the specified flag.
| flag | The flag you want to find the setting for |
Implements com::avpkit::core::IStreamCoder.
Definition at line 731 of file StreamCoder.cpp.
|
virtual |
Get the flags associated with this codec.
Implements com::avpkit::core::IStreamCoder.
Definition at line 718 of file StreamCoder.cpp.
|
virtual |
Get the frame-rate the attached stream claims to be using when DECODING, or the frame-rate we'll claim we're using when ENCODING.
Implements com::avpkit::core::IStreamCoder.
Definition at line 601 of file StreamCoder.cpp.
|
virtual |
Get the Global Quality setting this codec uses for video if a VideoPicture doesn't have a quality set.
Implements com::avpkit::core::IStreamCoder.
Definition at line 703 of file StreamCoder.cpp.
|
virtual |
The height, in pixels.
Implements com::avpkit::core::IStreamCoder.
Definition at line 533 of file StreamCoder.cpp.
|
virtual |
For this stream, get the next Pts that we expect to decode.
Note that this may not actually be the next Pts (for example due to transmission packet drops in the input source). Still it can be a useful tool.
Implements com::avpkit::core::IStreamCoder.
Definition at line 595 of file StreamCoder.cpp.
|
virtual |
Get the number of frames this StreamCoder had to drop to encode at the specified getTimeBase().
IStreamCoder objects can encode audio and video, but guarantee that every packet outputted has monotonically increasing timestamps (i.e. 0, 1, 2, 3, 4, 5, etc. without repeats). Sometimes data is passed too quickly into an IStreamCoder via encodeVideo or encodeAudio, and the underlying codec can't handle it that quickly. In those cases the IStreamCoder must drop the most recent frame of data.
If you're seeing a lot of dropped frames you can try either sending less frequent data to the IStreamCoder, or adjusting the getTimeBase() to the highest possible resolution. Be warned though; some codecs (such as MPEG2) require fixed time-bases (like 1/25) and so setting a higher resolution time base might end up with the codec not able to encode any data.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2227 of file StreamCoder.cpp.
|
virtual |
The the number of pictures in this Group of Pictures (GOP).
See the MPEG specs for what a GOP is officially, but this is the minimum number of frames between key-frames (or Intra-Frames in MPEG speak).
Implements com::avpkit::core::IStreamCoder.
Definition at line 622 of file StreamCoder.cpp.
|
virtual |
Returns the total number of settable properties on this object.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2098 of file StreamCoder.cpp.
|
virtual |
For Video streams, get the Pixel Format in use by the stream.
Implements com::avpkit::core::IStreamCoder.
Definition at line 635 of file StreamCoder.cpp.
|
virtual |
Gets the value of this property, and returns as a boolean.
| name | name of option |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2177 of file StreamCoder.cpp.
|
virtual |
Gets the value of this property, and returns as a double;.
| name | name of option |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2159 of file StreamCoder.cpp.
|
virtual |
Gets the value of this property, and returns as an long;.
| name | name of option |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2165 of file StreamCoder.cpp.
|
virtual |
Gets the value of this property, and returns as an IRational;.
| name | name of option |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2171 of file StreamCoder.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. Other language folks need not worry.
| name | property name |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2153 of file StreamCoder.cpp.
|
virtual |
Returns the name of the numbered property.
| name | The property name. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2110 of file StreamCoder.cpp.
|
virtual |
Returns the name of the numbered property.
| propertyNo | The property number in the options list. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2104 of file StreamCoder.cpp.
|
virtual |
Get the audio sample format.
Implements com::avpkit::core::IStreamCoder.
Definition at line 676 of file StreamCoder.cpp.
|
virtual |
Get the sample rate we use for this stream.
Implements com::avpkit::core::IStreamCoder.
Definition at line 663 of file StreamCoder.cpp.
|
virtual |
Gets the current level of standards compliance.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2308 of file StreamCoder.cpp.
|
virtual |
The associated Stream we're working on.
Implements com::avpkit::core::IStreamCoder.
Definition at line 467 of file StreamCoder.cpp.
|
virtual |
Get the time base this stream will ENCODE in, or the time base we detect while DECODING.
Caller must call release() on the returned value.
Implements com::avpkit::core::IStreamCoder.
Definition at line 559 of file StreamCoder.cpp.
|
virtual |
The width, in pixels.
Implements com::avpkit::core::IStreamCoder.
Definition at line 546 of file StreamCoder.cpp.
|
virtual |
Returns true if this IStreamCoder is currently open.
Implements com::avpkit::core::IStreamCoder.
Definition at line 2183 of file StreamCoder.cpp.
Referenced by com::avpkit::core::Stream::setStreamCoder().
|
virtual |
Open the Codec associated with this StreamCoder.
You can get the codec through getCodec(...) and set it with setCodec(...). You cannot call any set* methods after you've called open() on this StreamCoder until you close() it.
You must call close() when you're done, but if you don't, the container will clean up after you (but yell at you) when it is closed.
Implements com::avpkit::core::IStreamCoder.
Definition at line 757 of file StreamCoder.cpp.
|
virtual |
Open the codec with the given options.
Callers must call setCodec before calling this method.
| options | If non-NULL, a dictionary of parameter options to set for this codec. |
| unsetOptions | If non-NULL, on successful return the prior contents of this set of meta data will be replaced with any settings in 'options' that could not be set on this codec. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 762 of file StreamCoder.cpp.
References com::avpkit::core::MetaData::copy(), and com::avpkit::core::MetaData::getDictionary().
|
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 2076 of file StreamCoder.cpp.
|
virtual |
Should the IStreamCoder automatically adjust time stamps on output packets for the IStream it is ultimately destined for.
If this IStreamCoder does not know which IStream it is destined for, or this IStreamCoder isn't used with an IStream at all, then this setting is ignored.
| value | true to automatically adjust. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2233 of file StreamCoder.cpp.
|
virtual |
When ENCODING, sets the bit rate to use.
No-op when DECODING.
| rate | The bit rate to use. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 516 of file StreamCoder.cpp.
|
virtual |
When ENCODING set the bit rate tolerance.
No-op when DECODING.
| tolerance | The bit rate tolerance |
Implements com::avpkit::core::IStreamCoder.
Definition at line 527 of file StreamCoder.cpp.
|
virtual |
Set the number of channels to use when ENCODING.
Ignored if a non audio stream, or if DECODING.
| channels | The number of channels we'll encode with. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 696 of file StreamCoder.cpp.
|
virtual |
Set the Codec to the passed in Codec, discarding the old Codec if set.
Once you call setCodec, all settings on the IStreamCoder are reset to default values. So you probably want to call this first.
| codec | Codec to set. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 207 of file StreamCoder.cpp.
Referenced by setCodecID().
|
virtual |
Look up a Codec based on the passed in ID, and then set it.
To see if you actually set the correct ID, call getCodec() and check for 0 (null).
Once you call setCodec, all settings on the IStreamCoder are reset to default values. So you probably want to call this first.
| id | ID of codec to set. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 255 of file StreamCoder.cpp.
|
inlinevirtual |
Look up a Codec based on the passed in ID, and then set it.
Forwards to setCodecID(com.avpkit.core.ICodec.ID)
To see if you actually set the correct ID, call getCodec() and check for 0 (null).
Once you call setCodec, all settings on the IStreamCoder are reset to default values. So you probably want to call this first.
| id | ID of codec to set. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 53 of file StreamCoder.h.
References setCodec().
|
virtual |
Set the 4-byte FOURCC tag for this coder.
| fourcc | The FOURCC to set, with Least Significant Byte first. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2091 of file StreamCoder.cpp.
|
virtual |
Set the default audio frame size.
| aNewSize | The new number of samples to use to encode samples into a packet. This setting is ignored if <= 0 or if the codec requires it's own frame size (e.g. Nellymoser). |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2195 of file StreamCoder.cpp.
|
virtual |
Copies data from the given buffer into the extra-data area maintained by encoders.
This is an extremely advanced method, and incorrect usage can result in Java crashes so take care. In general people should not need to use this.
For some codecs (e.g. for H264, this is global header information and for rv10 it is additional flags), AVPKit maintains extra information about the codec in a extra data buffer. In general AVPKit will allocate this data as needed and you never need to set it (or get it). But if you know what you're doing, you can ask AVPKit to replace the existing extra data for the given codec with a copy of the data in the given buffer.
You should call this method after you call open() but before you encode or decode any media.
| src | The data to copy |
| offset | The position, in bytes, to start copying data from src |
| length | The number of bytes to copy from data |
| allocNew | If true, and there is not enough space in the existing extra data buffer, then AVPKit will discard the old buffer and allocate a new buffer. If false, then AVPKit will attempt to copy the data into the existing buffer and if there is not enough space in the existing buffer, no bytes will be copied and an error will be returned. In general, you should set this to false if that works for you. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2246 of file StreamCoder.cpp.
References com::avpkit::ferry::IBuffer::getBytes().
|
virtual |
Set the flag.
| flag | The flag to set |
| value | The value to set it to (true or false) |
Implements com::avpkit::core::IStreamCoder.
Definition at line 740 of file StreamCoder.cpp.
|
virtual |
Set the FFMPEG flags to use with this codec.
All values must be ORed (|) together.
| newFlags | The new set flags for this codec. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 724 of file StreamCoder.cpp.
|
virtual |
Set the frame rate we'll set in the headers of this stream while ENCODING.
Note that you can set whatever frame-rate you'd like, but the TimeBase and the PTS you set on the encoded audio and video frames can override this.
As a convenience, we forward this call to the Stream::setFrameRate() method.
| newFrameRate | The new frame rate to use. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 610 of file StreamCoder.cpp.
References com::avpkit::core::IRational::getDenominator(), and com::avpkit::core::IRational::getNumerator().
|
virtual |
Set the Global Quality to a new value.
| newQuality | The new global quality. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 709 of file StreamCoder.cpp.
|
virtual |
Try to change current decoder to an HW decoder compatible with pixel format.
| type | an HW accelerated pixel format |
Implements com::avpkit::core::IStreamCoder.
Definition at line 2325 of file StreamCoder.cpp.
|
virtual |
Set the height, in pixels.
| height | Sets the height of video frames we'll encode. No-op when DECODING. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 539 of file StreamCoder.cpp.
|
virtual |
Set the GOPS on this stream.
Ignored if DECODING.
| gops | The new GOPS for the stream we're encoding. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 628 of file StreamCoder.cpp.
|
virtual |
Set the pixel format to ENCODE with.
Ignored if audio or DECODING.
| pixelFmt | Pixel format to use. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 654 of file StreamCoder.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::IStreamCoder.
Definition at line 2141 of file StreamCoder.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::IStreamCoder.
Definition at line 2123 of file StreamCoder.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::IStreamCoder.
Definition at line 2129 of file StreamCoder.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::IStreamCoder.
Definition at line 2135 of file StreamCoder.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::IStreamCoder.
Definition at line 2147 of file StreamCoder.cpp.
|
virtual |
Set the sample format when ENCODING.
Ignored if DECODING or if the coder is already open.
| aFormat | The sample format. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 683 of file StreamCoder.cpp.
|
virtual |
Set the sample rate to use when ENCODING.
Ignored if DECODING or a non-audio stream.
| sampleRate | New sample rate (in Hz) to use. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 669 of file StreamCoder.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::IStreamCoder.
Definition at line 2316 of file StreamCoder.cpp.
|
virtual |
Set the time base we'll use to ENCODE with.
A no-op when DECODING.
As a convenience, we forward this call to the Stream::setTimeBase() method.
| newTimeBase | The new time base to use. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 581 of file StreamCoder.cpp.
References com::avpkit::core::IRational::getDenominator(), and com::avpkit::core::IRational::getNumerator().
|
virtual |
Set the width, in pixels.
| width | Sets the width of video frames we'll encode. No-op when DECODING. |
Implements com::avpkit::core::IStreamCoder.
Definition at line 552 of file StreamCoder.cpp.