|
AVPKit
|
Represents one raw (undecoded) picture in a video stream, plus a timestamp for when to display that video picture relative to other items in a IContainer. More...
#include <IVideoPicture.h>


Public Types | |
| 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 } |
Public Member Functions | |
| virtual bool | isKeyFrame ()=0 |
| Is this a key frame? More... | |
| virtual void | setKeyFrame (bool aIsKey)=0 |
| Reset if this is a key frame or not. More... | |
| virtual bool | isComplete ()=0 |
| Is this picture completely decoded? More... | |
| virtual int32_t | getSize ()=0 |
| Total size in bytes of the decoded picture. More... | |
| virtual int | getWidth ()=0 |
| What is the width of the picture. More... | |
| virtual int | getHeight ()=0 |
| What is the height of the picture. More... | |
| virtual IPixelFormat::Type | getPixelType ()=0 |
| Returns the pixel format of the picture. More... | |
| virtual int64_t | getPts ()=0 |
| What is the Presentation Time Stamp (in Microseconds) of this picture. More... | |
| virtual void | setPts (int64_t value)=0 |
| Set the Presentation Time Stamp (in Microseconds) for this picture. More... | |
| virtual int | getQuality ()=0 |
| 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)=0 |
| Set the Quality to a new value. More... | |
| virtual int | getDataLineSize (int lineNo)=0 |
| 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)=0 |
| 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 *srcPicture)=0 |
| Copy the contents of the given picture into this picture. More... | |
| virtual void | render (bool drop=false, int64_t timeStamp=-1)=0 |
| Render this picture on configured surface. More... | |
| virtual void * | getOpaqueData ()=0 |
| virtual PictType | getPictureType ()=0 |
| Get the picture type. More... | |
| virtual void | setPictureType (PictType type)=0 |
| Set the picture type. More... | |
| virtual void | setSideData (FrameDataType type, com::avpkit::ferry::IBuffer *buffer)=0 |
Public Member Functions inherited from com::avpkit::core::IMediaData | |
| virtual int64_t | getTimeStamp ()=0 |
| Get the time stamp of this object in getTimeBase() units. More... | |
| virtual void | setTimeStamp (int64_t aTimeStamp)=0 |
| Set the time stamp for this object in getTimeBase() units. More... | |
| virtual IRational * | getTimeBase ()=0 |
| Get the time base that time stamps of this object are represented in. More... | |
| virtual void | setTimeBase (IRational *aBase)=0 |
| Set the time base that time stamps of this object are represented in. More... | |
| virtual com::avpkit::ferry::IBuffer * | getData ()=0 |
| Get any underlying raw data available for this object. More... | |
| virtual bool | isKey ()=0 |
| Is this object a key object? i.e. More... | |
| virtual void | setData (com::avpkit::ferry::IBuffer *buffer)=0 |
| Sets the underlying buffer used by this object. 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 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 | |
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. | |
Represents one raw (undecoded) picture in a video stream, plus a timestamp for when to display that video picture relative to other items in a IContainer.
All timestamps for this object are always in Microseconds.
Definition at line 39 of file IVideoPicture.h.
Definition at line 255 of file IVideoPicture.h.
The different types of images that we can set.
Definition at line 221 of file IVideoPicture.h.
|
pure 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. |
Implemented in com::avpkit::core::VideoPicture.
Referenced by make().
|
pure 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. |
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
What is the height of the picture.
Implemented in com::avpkit::core::VideoPicture.
Referenced by com::avpkit::core::VideoPicture::copy(), com::avpkit::core::IPixelFormat::getYUV420PPixelOffset(), and make().
|
pure 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.
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
Returns the pixel format of the picture.
Implemented in com::avpkit::core::VideoPicture.
Referenced by com::avpkit::core::VideoPicture::copy(), com::avpkit::core::IPixelFormat::getYUV420PPixelOffset(), and make().
|
pure 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.
Implemented in com::avpkit::core::VideoPicture.
Referenced by com::avpkit::core::VideoPicture::copy().
|
pure 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()
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
Total size in bytes of the decoded picture.
Implements com::avpkit::core::IMediaData.
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
What is the width of the picture.
Implemented in com::avpkit::core::VideoPicture.
Referenced by com::avpkit::core::VideoPicture::copy(), com::avpkit::core::IPixelFormat::getYUV420PPixelOffset(), and make().
|
pure virtual |
Is this picture completely decoded?
Implemented in com::avpkit::core::VideoPicture.
Referenced by com::avpkit::core::VideoPicture::copy().
|
pure virtual |
|
static |
Get a new picture object, by wrapping an existing com.avpkit.ferry.IBuffer.
Use this method if you have existing video data that you want to have us wrap and pass to FFmpeg. Note that if decoding into this video picture and the decoded data actually takes more space than is in this buffer, this object will release the reference to the passed in buffer and allocate a new buffer instead so the decode can continue.
Due to some decoders assembly optimizations, you should ensure the IBuffer you pass in has at least 8 more bytes than would typically be required based on the format, width and height.
| buffer | The com.avpkit.ferry.IBuffer to wrap. |
| format | The pixel format (for example, YUV420P). |
| width | The width of the picture, in pixels. |
| height | The height of the picture, in pixels. |
Definition at line 48 of file IVideoPicture.cpp.
References com::avpkit::core::Global::init(), and com::avpkit::core::VideoPicture::make().
|
static |
Get a new picture object.
You can specify -1 for width and height, in which case all getData() methods will return error until AVPKIT decodes something into this frame. In general you should always try to specify the width and height.
Note that any buffers this objects needs will be lazily allocated (i.e. we won't actually grab all the memory until we need it).
This is useful because it allows you to hold a IVideoPicture object that remembers things like format, width, and height, but know that it doesn't actually take up a lot of memory until the first time someone tries to access that memory.
| format | The pixel format (for example, YUV420P). |
| width | The width of the picture, in pixels, or -1 if you want AVPKIT to guess when decoding. |
| height | The height of the picture, in pixels, or -1 if you want AVPKIT to guess when decoding. |
Definition at line 41 of file IVideoPicture.cpp.
References com::avpkit::core::Global::init(), and com::avpkit::core::VideoPicture::make().
Referenced by make().
|
static |
Get a new picture by copying the data in an existing frame.
| src | The picture to copy. |
Definition at line 58 of file IVideoPicture.cpp.
References copy(), getHeight(), getPixelType(), getWidth(), com::avpkit::core::Global::init(), and make().
|
pure 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.
Implemented in com::avpkit::core::VideoPicture.
|
pure 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. |
Implemented in com::avpkit::core::VideoPicture.
|
pure 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. |
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
Set the picture type.
| type | The type. |
Implemented in com::avpkit::core::VideoPicture.
|
pure virtual |
Set the Presentation Time Stamp (in Microseconds) for this picture.
| value | the new timestamp |
Implemented in com::avpkit::core::VideoPicture.
|
pure 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. |
Implemented in com::avpkit::core::VideoPicture.