AVPKit
IVideoPicture.h
1 /*******************************************************************************
2  * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved.
3  *
4  * This file is part of AVPKit.
5  *
6  * AVPKit is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * AVPKit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with AVPKit. If not, see <http://www.gnu.org/licenses/>.
18  *******************************************************************************/
19 
20 #ifndef IVIDEOPICTURE_H_
21 #define IVIDEOPICTURE_H_
22 
23 #include <com/avpkit/core/AVPKit.h>
24 #include <com/avpkit/core/IMediaData.h>
25 #include <com/avpkit/core/IPixelFormat.h>
26 #include <com/avpkit/ferry/IBuffer.h>
27 #include <com/avpkit/core/IRational.h>
28 
29 namespace com { namespace avpkit { namespace core
30 {
31 
39  class VS_API_AVPKIT IVideoPicture : public IMediaData
40  {
41  public:
47  virtual bool isKeyFrame()=0;
48 
56  virtual void setKeyFrame(bool aIsKey)=0;
57 
63  virtual bool isComplete()=0;
64 
70  virtual int32_t getSize()=0;
71 
77  virtual int getWidth()=0;
78 
84  virtual int getHeight()=0;
85 
92 
101  virtual int64_t getPts()=0;
102 
110  virtual void setPts(int64_t value)=0;
111 
119  virtual int getQuality()=0;
120 
128  virtual void setQuality(int newQuality)=0;
129 
139  virtual int getDataLineSize(int lineNo)=0;
140 
155  virtual void setComplete(bool aIsComplete, IPixelFormat::Type format,
156  int width, int height, int64_t pts)=0;
157 
166  virtual bool copy(IVideoPicture* srcPicture)=0;
167 
174  virtual void render(bool drop = false, int64_t timeStamp = -1)=0;
175 
176 #ifndef SWIG
177  virtual void* getOpaqueData()=0;
178 #endif
179 
203  static IVideoPicture* make(IPixelFormat::Type format, int width, int height);
204 
210  static IVideoPicture* make(IVideoPicture* src);
211 
212  /*
213  * Added for 3.1
214  */
215 
221  typedef enum {
222  DEFAULT_TYPE=0,
223  I_TYPE = 1,
224  P_TYPE = 2,
225  B_TYPE = 3,
226  S_TYPE = 4,
227  SI_TYPE = 5,
228  SP_TYPE = 6,
229  BI_TYPE = 7,
230  } PictType;
231 
252  virtual void setPictureType(PictType type)=0;
253 
254 
255  typedef enum {
332 
338 
344 
351  } FrameDataType;
352 
353  virtual void setSideData(FrameDataType type, com::avpkit::ferry::IBuffer* buffer) = 0;
354 
355  /*
356  * Added for 3.1
357  */
358 
381  static IVideoPicture* make(
383  IPixelFormat::Type format, int width, int height);
384 
385  protected:
386  IVideoPicture();
387  virtual ~IVideoPicture();
388  };
389 
390 }}}
391 
392 #endif /*IVIDEOPICTURE_H_*/
The parent class of all media objects than can be gotten from an IStream.
Definition: IMediaData.h:34
Represents one raw (undecoded) picture in a video stream, plus a timestamp for when to display that v...
Definition: IVideoPicture.h:40
virtual int getWidth()=0
What is the width of the picture.
virtual int getHeight()=0
What is the height of the picture.
virtual PictType getPictureType()=0
Get the picture type.
virtual int32_t getSize()=0
Total size in bytes of the decoded picture.
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 comp...
virtual bool copy(IVideoPicture *srcPicture)=0
Copy the contents of the given picture into this picture.
virtual int getQuality()=0
This value is the quality setting this VideoPicture had when it was decoded, or is the value to use w...
virtual IPixelFormat::Type getPixelType()=0
Returns the pixel format of the picture.
virtual int getDataLineSize(int lineNo)=0
Return the size of each line in the VideoPicture data.
virtual void setPictureType(PictType type)=0
Set the picture type.
virtual bool isComplete()=0
Is this picture completely decoded?
virtual bool isKeyFrame()=0
Is this a key frame?
PictType
The different types of images that we can set.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
@ AV_FRAME_DATA_ICC_PROFILE
The data contains an ICC profile as an opaque octet buffer following the format described by ISO 1507...
@ AV_FRAME_DATA_MOTION_VECTORS
Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec A...
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
@ AV_FRAME_DATA_PANSCAN
The data is the AVPanScan struct defined in libavcodec.
@ AV_FRAME_DATA_MATRIXENCODING
The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
@ AV_FRAME_DATA_SPHERICAL
The data represents the AVSphericalMapping structure defined in libavutil/spherical....
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AV_FRAME_DATA_AUDIO_SERVICE_TYPE
This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defi...
@ AV_FRAME_DATA_DOWNMIX_INFO
Metadata relevant to a downmix procedure.
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
@ AV_FRAME_DATA_SKIP_SAMPLES
Recommmends skipping the specified number of samples.
@ AV_FRAME_DATA_REPLAYGAIN
ReplayGain information in the form of the AVReplayGain struct.
virtual void render(bool drop=false, int64_t timeStamp=-1)=0
Render this picture on configured surface.
virtual void setKeyFrame(bool aIsKey)=0
Reset if this is a key frame or not.
virtual int64_t getPts()=0
What is the Presentation Time Stamp (in Microseconds) of this picture.
virtual void setQuality(int newQuality)=0
Set the Quality to a new value.
virtual void setPts(int64_t value)=0
Set the Presentation Time Stamp (in Microseconds) for this picture.
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
Definition: IBuffer.h:54
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...