|
AVPKit
|


Public Member Functions | |
| virtual int64_t | getTimeStamp () |
| Get the time stamp of this object in getTimeBase() units. More... | |
| virtual void | setTimeStamp (int64_t aTimeStamp) |
| Set the time stamp for this object in getTimeBase() units. More... | |
| virtual bool | isKey () |
| Is this object a key object? i.e. More... | |
| virtual IRational * | getTimeBase () |
| Get the time base that time stamps of this object are represented in. More... | |
| virtual void | setTimeBase (IRational *aBase) |
| Set the time base that time stamps of this object are represented in. More... | |
| virtual bool | isKeyFrame () |
| Is this a key frame? More... | |
| virtual void | setKeyFrame (bool aIsKey) |
| Reset if this is a key frame or not. More... | |
| virtual bool | isComplete () |
| Is this picture completely decoded? More... | |
| virtual int | getWidth () |
| What is the width of the picture. More... | |
| virtual int | getHeight () |
| What is the height of the picture. More... | |
| virtual IPixelFormat::Type | getPixelType () |
| Returns the pixel format of the picture. More... | |
| virtual int64_t | getPts () |
| What is the Presentation Time Stamp (in Microseconds) of this picture. More... | |
| virtual void | setPts (int64_t) |
| Set the Presentation Time Stamp (in Microseconds) for this picture. More... | |
| virtual int | getQuality () |
| This value is the quality setting this VideoPicture had when it was decoded, or is the value to use when this picture is next encoded (if reset with setQuality() More... | |
| virtual void | setQuality (int newQuality) |
| Set the Quality to a new value. More... | |
| virtual int32_t | getSize () |
| Total size in bytes of the decoded picture. More... | |
| virtual com::avpkit::ferry::IBuffer * | getData () |
| Get any underlying raw data available for this object. More... | |
| virtual int | getDataLineSize (int lineNo) |
| Return the size of each line in the VideoPicture data. More... | |
| virtual void | setComplete (bool aIsComplete, IPixelFormat::Type format, int width, int height, int64_t pts) |
| After modifying the raw data in this buffer, call this function to let the object know it is now complete. More... | |
| virtual bool | copy (IVideoPicture *srcFrame) |
| Copy the contents of the given picture into this picture. More... | |
| virtual void | setData (com::avpkit::ferry::IBuffer *buffer) |
| Sets the underlying buffer used by this object. More... | |
| virtual void | render (bool drop, int64_t timeStamp) |
| Render this picture on configured surface. More... | |
| virtual void * | getOpaqueData () |
| void | fillAVFrame (AVFrame *frame) |
| Called by the StreamCoder before it encodes a picture. More... | |
| void | copyAVFrame (AVFrame *frame, IPixelFormat::Type pixel, int32_t width, int32_t height) |
| Called by the StreamCoder once it's done decoding. More... | |
| VS_API_AVPKIT AVFrame * | getAVFrame () |
| Call to get the raw underlying AVFrame we manage; don't pass this to ffmpeg directly as ffmpeg often does weird stuff to these guys. More... | |
| virtual IVideoPicture::PictType | getPictureType () |
| Get the picture type. More... | |
| virtual void | setPictureType (IVideoPicture::PictType type) |
| Set the picture type. More... | |
| virtual void | setSideData (IVideoPicture::FrameDataType type, com::avpkit::ferry::IBuffer *buffer) |
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 VideoPicture * | make (IPixelFormat::Type format, int width, int height) |
| The default factory for a frame. More... | |
| static VideoPicture * | make (com::avpkit::ferry::IBuffer *buffer, IPixelFormat::Type format, int width, int height) |
Static Public Member Functions inherited from com::avpkit::core::IVideoPicture | |
| static IVideoPicture * | make (IPixelFormat::Type format, int width, int height) |
| Get a new picture object. More... | |
| static IVideoPicture * | make (IVideoPicture *src) |
| Get a new picture by copying the data in an existing frame. More... | |
| static IVideoPicture * | make (com::avpkit::ferry::IBuffer *buffer, IPixelFormat::Type format, int width, int height) |
| Get a new picture object, by wrapping an existing com.avpkit.ferry.IBuffer. More... | |
Additional Inherited Members | |
Public Types inherited from com::avpkit::core::IVideoPicture | |
| enum | PictType { DEFAULT_TYPE =0 , I_TYPE = 1 , P_TYPE = 2 , B_TYPE = 3 , S_TYPE = 4 , SI_TYPE = 5 , SP_TYPE = 6 , BI_TYPE = 7 } |
| The different types of images that we can set. More... | |
| enum | FrameDataType { AV_FRAME_DATA_PANSCAN , AV_FRAME_DATA_A53_CC , AV_FRAME_DATA_STEREO3D , AV_FRAME_DATA_MATRIXENCODING , AV_FRAME_DATA_DOWNMIX_INFO , AV_FRAME_DATA_REPLAYGAIN , AV_FRAME_DATA_DISPLAYMATRIX , AV_FRAME_DATA_AFD , AV_FRAME_DATA_MOTION_VECTORS , AV_FRAME_DATA_SKIP_SAMPLES , AV_FRAME_DATA_AUDIO_SERVICE_TYPE , AV_FRAME_DATA_MASTERING_DISPLAY_METADATA , AV_FRAME_DATA_GOP_TIMECODE , AV_FRAME_DATA_SPHERICAL , AV_FRAME_DATA_CONTENT_LIGHT_LEVEL , AV_FRAME_DATA_ICC_PROFILE } |
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 33 of file VideoPicture.h.
|
virtual |
Copy the contents of the given picture into this picture.
All buffers are copied by value, not be reference.
| srcPicture | The picture you want to copy. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 155 of file VideoPicture.cpp.
References com::avpkit::ferry::IBuffer::getBytes(), com::avpkit::core::IVideoPicture::getHeight(), com::avpkit::core::IVideoPicture::getPixelType(), com::avpkit::core::IVideoPicture::getPts(), getSize(), com::avpkit::core::IVideoPicture::getWidth(), com::avpkit::core::IVideoPicture::isComplete(), and setComplete().
| void com::avpkit::core::VideoPicture::copyAVFrame | ( | AVFrame * | frame, |
| IPixelFormat::Type | pixel, | ||
| int32_t | width, | ||
| int32_t | height | ||
| ) |
Called by the StreamCoder once it's done decoding.
We copy data from the buffers that ffmpeg allocated into our own buffers.
| frame | The AVFrame that ffmpeg filled in. |
| pixel | The pixel type |
| width | The width of the AVFrame |
| height | The height of the AVFrame |
Definition at line 279 of file VideoPicture.cpp.
References com::avpkit::ferry::IBuffer::getBufferSize(), com::avpkit::ferry::IBuffer::getBytes(), getSize(), and com::avpkit::core::IPixelFormat::MEDIACODEC.
Referenced by com::avpkit::core::StreamCoder::decodeVideo(), and com::avpkit::core::BufferSink::fillVideoPicture().
| void com::avpkit::core::VideoPicture::fillAVFrame | ( | AVFrame * | frame | ) |
Called by the StreamCoder before it encodes a picture.
The VideoPicture fills in Ffmpeg's AVFrame structure with the underlying data for the frame we're managing, but we maintain memory management.
Definition at line 257 of file VideoPicture.cpp.
References com::avpkit::ferry::IBuffer::getBufferSize(), com::avpkit::ferry::IBuffer::getBytes(), getQuality(), and getSize().
Referenced by com::avpkit::core::StreamCoder::encodeVideo().
| AVFrame * com::avpkit::core::VideoPicture::getAVFrame | ( | ) |
Call to get the raw underlying AVFrame we manage; don't pass this to ffmpeg directly as ffmpeg often does weird stuff to these guys.
Note: This method is exported out of the DLL because the extras library uses it.
Definition at line 347 of file VideoPicture.cpp.
References com::avpkit::ferry::IBuffer::getBufferSize(), and getSize().
Referenced by com::avpkit::core::BufferSource::addVideoPicture(), getDataLineSize(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
Get any underlying raw data available for this object.
Implements com::avpkit::core::IMediaData.
Definition at line 196 of file VideoPicture.cpp.
References com::avpkit::ferry::RefPointer< T >::get(), com::avpkit::ferry::IBuffer::getBufferSize(), and getSize().
|
virtual |
Return the size of each line in the VideoPicture data.
Usually there are no more than 4 lines, but the first line no that returns 0 is the end of the road.
| lineNo | The line you want to know the (byte) size of. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 358 of file VideoPicture.cpp.
References getAVFrame().
|
inlinevirtual |
What is the height of the picture.
Implements com::avpkit::core::IVideoPicture.
Definition at line 49 of file VideoPicture.h.
Referenced by com::avpkit::core::StreamCoder::encodeVideo(), com::avpkit::core::BufferSink::fillVideoPicture(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
Get the picture type.
This will be set on decoding to tell you what type of packet this was decoded from, and when encoding is a request to the encoder for how to encode the picture.
The request may be ignored by your codec.
Implements com::avpkit::core::IVideoPicture.
Definition at line 507 of file VideoPicture.cpp.
|
inlinevirtual |
Returns the pixel format of the picture.
Implements com::avpkit::core::IVideoPicture.
Definition at line 50 of file VideoPicture.h.
Referenced by com::avpkit::core::StreamCoder::encodeVideo(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
What is the Presentation Time Stamp (in Microseconds) of this picture.
The PTS is is scaled so that 1 PTS = 1/1,000,000 of a second.
Implements com::avpkit::core::IVideoPicture.
Definition at line 382 of file VideoPicture.cpp.
Referenced by com::avpkit::core::BufferSource::addVideoPicture(), com::avpkit::core::StreamCoder::encodeVideo(), getTimeStamp(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
This value is the quality setting this VideoPicture had when it was decoded, or is the value to use when this picture is next encoded (if reset with setQuality()
Implements com::avpkit::core::IVideoPicture.
Definition at line 395 of file VideoPicture.cpp.
Referenced by fillAVFrame(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
Total size in bytes of the decoded picture.
Implements com::avpkit::core::IVideoPicture.
Definition at line 442 of file VideoPicture.cpp.
Referenced by copy(), copyAVFrame(), com::avpkit::core::StreamCoder::encodeVideo(), fillAVFrame(), getAVFrame(), getData(), and make().
|
inlinevirtual |
Get the time base that time stamps of this object are represented in.
Caller must release the returned value.
Implements com::avpkit::core::IMediaData.
Definition at line 41 of file VideoPicture.h.
Referenced by com::avpkit::core::BufferSource::addVideoPicture(), and com::avpkit::core::BufferSink::fillVideoPicture().
|
inlinevirtual |
Get the time stamp of this object in getTimeBase() units.
Implements com::avpkit::core::IMediaData.
Definition at line 38 of file VideoPicture.h.
References getPts().
|
inlinevirtual |
What is the width of the picture.
Implements com::avpkit::core::IVideoPicture.
Definition at line 48 of file VideoPicture.h.
Referenced by com::avpkit::core::StreamCoder::encodeVideo(), com::avpkit::core::BufferSink::fillVideoPicture(), and com::avpkit::core::VideoResampler::resample().
|
inlinevirtual |
Is this picture completely decoded?
Implements com::avpkit::core::IVideoPicture.
Definition at line 47 of file VideoPicture.h.
Referenced by com::avpkit::core::VideoResampler::resample().
|
inlinevirtual |
Is this object a key object? i.e.
it can be interpreted without needing any other media objects
Implements com::avpkit::core::IMediaData.
Definition at line 40 of file VideoPicture.h.
References isKeyFrame().
|
virtual |
Is this a key frame?
Implements com::avpkit::core::IVideoPicture.
Definition at line 369 of file VideoPicture.cpp.
Referenced by isKey().
|
static |
Use the buffer
Set the internal flags
Definition at line 101 of file VideoPicture.cpp.
References com::avpkit::ferry::IBuffer::getBufferSize(), com::avpkit::ferry::IBuffer::getBytes(), getSize(), make(), and com::avpkit::ferry::RefPointer< T >::reset().
|
static |
The default factory for a frame.
We require callers to always tell us the format, width and height of the image they want to store in this VideoPicture.
| format | The pixel format |
| width | The expected width of this image. |
| height | The expected height of this image. |
Definition at line 75 of file VideoPicture.cpp.
References setKeyFrame().
Referenced by make(), and com::avpkit::core::IVideoPicture::make().
|
virtual |
Render this picture on configured surface.
Works only with HW accelerated com.avpkit.core.IPixelFormat. com.avpkit.core.IStreamCoder#setHardwareDecoding(IPixelFormat.Type, Object) must be called before opening decoder.
Implements com::avpkit::core::IVideoPicture.
Definition at line 222 of file VideoPicture.cpp.
|
virtual |
After modifying the raw data in this buffer, call this function to let the object know it is now complete.
| aIsComplete | Is this VideoPicture complete |
| format | The pixel format of the data in this picture. Must match what the picture was originally constructed with. |
| width | The width of the data in this picture. Must match what the picture was originally constructed with. |
| height | The height of the data in this picture. Must match what the picture was originally constructed with. |
| pts | The presentation timestamp of the picture that is now complete. The caller must ensure this PTS is in units of 1/1,000,000 seconds. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 410 of file VideoPicture.cpp.
References setPts().
Referenced by copy(), com::avpkit::core::StreamCoder::decodeVideo(), com::avpkit::core::BufferSink::fillVideoPicture(), and com::avpkit::core::VideoResampler::resample().
|
virtual |
Sets the underlying buffer used by this object.
This is an advanced method and is not recommended for use by those who don't fully understand how IBuffers work. Implementations of IMediaData may behave in undefined ways if the buffer you pass in is not big enough for what you ask them to do (e.g. they may discard your buffer and allocate a larger one if they need more space). It is up to the caller to ensure the buffer passed in is large enough, and is not simultaneously in use by another part of the system.
| buffer | The buffer to set. If null, this method is ignored. |
Use the buffer
Implements com::avpkit::core::IMediaData.
Definition at line 147 of file VideoPicture.cpp.
References com::avpkit::ferry::RefPointer< T >::reset().
|
virtual |
Reset if this is a key frame or not.
Note that regardless of how this flag is set, an IVideoPicture always contains raw video data (hence the key setting isn't really that important).
| aIsKey | True if a key frame; false if not. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 375 of file VideoPicture.cpp.
Referenced by make().
|
virtual |
Set the picture type.
| type | The type. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 516 of file VideoPicture.cpp.
|
virtual |
Set the Presentation Time Stamp (in Microseconds) for this picture.
| value | the new timestamp |
Implements com::avpkit::core::IVideoPicture.
Definition at line 388 of file VideoPicture.cpp.
Referenced by setComplete(), and setTimeStamp().
|
virtual |
Set the Quality to a new value.
This will be used the next time this VideoPicture is encoded by a StreamCoder
| newQuality | The new quality. |
Implements com::avpkit::core::IVideoPicture.
Definition at line 401 of file VideoPicture.cpp.
Referenced by com::avpkit::core::VideoResampler::resample().
|
inlinevirtual |
Set the time base that time stamps of this object are represented in.
| aBase | the new time base. If null an exception is thrown. |
Implements com::avpkit::core::IMediaData.
Definition at line 42 of file VideoPicture.h.
|
inlinevirtual |
Set the time stamp for this object in getTimeBase() units.
| aTimeStamp | The time stamp |
Implements com::avpkit::core::IMediaData.
Definition at line 39 of file VideoPicture.h.
References setPts().