|
StormByte C++ Library: Multimedia module 0.0.9999
StormByte-Multimedia is a StormByte library module for parsing configuration files
|
RAII owner of a libav AVFrame. More...
#include <StormByte/multimedia/ffmpeg/AVFrame.hxx>


Public Types | |
| enum class | VideoLayout : std::uint8_t { Unknown , Gray , Yuv420 , Yuv422 , Yuv444 } |
| Planar video family, ignoring bit depth. More... | |
Public Member Functions | |
| AVFrame () noexcept | |
| Allocates an empty frame (av_frame_alloc). | |
| AVFrame (AVFrame &&other) noexcept=default | |
| Move constructor. | |
| ~AVFrame () noexcept override | |
| Destructor. | |
| AVFrame & | operator= (AVFrame &&other) noexcept=default |
| Move assignment. | |
| operator bool () const noexcept | |
| True when a libav struct is owned. | |
| AVFrame | Clone () const noexcept |
Independent clone (av_frame_clone). | |
| bool | Ref (const AVFrame &other) noexcept |
Shares buffers with other (av_frame_ref). | |
| bool | Copy (const AVFrame &other) noexcept |
Copies samples/planes from other (av_frame_copy). | |
| bool | CopyProps (const AVFrame &other) noexcept |
Copies metadata from other (av_frame_copy_props). | |
| bool | GetBuffer (int align=0) noexcept |
Allocates plane buffers (av_frame_get_buffer). | |
| bool | MakeWritable () noexcept |
Ensures unique buffers (av_frame_make_writable). | |
| bool | Writable () const noexcept |
| Whether plane buffers are uniquely owned. | |
| bool | AllocVideo (int width, int height, int format, int align=0) noexcept |
| Sets video geometry and format, then allocates planes. | |
| bool | AllocAudio (int nb_samples, int format, const AVChannelLayout &layout, int sample_rate) noexcept |
| Sets audio samples, format and layout, then allocates planes. | |
| void | Unref () noexcept |
Unreferences frame buffers (av_frame_unref). | |
| int | Width () const noexcept |
| Frame width in pixels. | |
| void | Width (int width) noexcept |
| Sets frame width. | |
| int | Height () const noexcept |
| Frame height in pixels. | |
| void | Height (int height) noexcept |
| Sets frame height. | |
| int | Format () const noexcept |
| Pixel or sample format. | |
| void | Format (int format) noexcept |
| Sets pixel or sample format. | |
| bool | Hardware () const noexcept |
| Whether the pixel format is hardware-backed. | |
| VideoLayout | Layout () const noexcept |
| Planar layout of this frame. | |
| std::int64_t | Pts () const noexcept |
| Presentation timestamp in stream ticks. | |
| void | Pts (std::int64_t pts) noexcept |
| Sets presentation timestamp in stream ticks. | |
| std::int64_t | BestEffortTimestamp () const noexcept |
Best-effort timestamp (best_effort_timestamp). | |
| void | BestEffortTimestamp (std::int64_t ts) noexcept |
| Sets the best-effort timestamp. | |
| std::int64_t | DurationTicks () const noexcept |
| Duration in stream ticks. | |
| void | DurationTicks (std::int64_t duration) noexcept |
| Sets duration in stream ticks. | |
| int | ColorRange () const noexcept |
| Color range. | |
| void | ColorRange (int range) noexcept |
| Sets color range. | |
| int | ColorSpace () const noexcept |
| Matrix coefficients. | |
| void | ColorSpace (int space) noexcept |
| Sets matrix coefficients. | |
| int | ColorPrimaries () const noexcept |
| Color primaries. | |
| void | ColorPrimaries (int primaries) noexcept |
| Sets color primaries. | |
| int | ColorTransfer () const noexcept |
| Transfer characteristics. | |
| void | ColorTransfer (int transfer) noexcept |
| Sets transfer characteristics. | |
| int | ChromaLocation () const noexcept |
| Chroma sample location. | |
| void | ChromaLocation (int location) noexcept |
| Sets chroma sample location. | |
| AVRational | SampleAspectRatio () const noexcept |
| Sample aspect ratio. | |
| void | SampleAspectRatio (AVRational sar) noexcept |
| Sets sample aspect ratio. | |
| int | PictType () const noexcept |
Picture type (I/P/B/…). | |
| void | PictType (int type) noexcept |
| Sets picture type. | |
| bool | KeyFrame () const noexcept |
| Whether this is a key frame. | |
| void | KeyFrame (bool key) noexcept |
| Marks the frame as a key frame or not. | |
| int | RepeatPict () const noexcept |
Extra delay in field durations (repeat_pict). | |
| void | RepeatPict (int repeat) noexcept |
Sets repeat_pict. | |
| bool | Interlaced () const noexcept |
| Whether the frame is interlaced. | |
| void | Interlaced (bool interlaced, bool top_first) noexcept |
| Marks the frame as interlaced or progressive. | |
| bool | TopFieldFirst () const noexcept |
| Whether the top field is first (interlaced). | |
| int | CropLeft () const noexcept |
| Left crop in pixels. | |
| int | CropRight () const noexcept |
| Right crop in pixels. | |
| int | CropTop () const noexcept |
| Top crop in pixels. | |
| int | CropBottom () const noexcept |
| Bottom crop in pixels. | |
| void | Crop (int left, int right, int top, int bottom) noexcept |
| Sets crop window. | |
| bool | ApplyCropping (int flags=0) noexcept |
Applies the crop window (av_frame_apply_cropping). | |
| int | PlaneCount () const noexcept |
| Number of video components or audio channels. | |
| int | PlaneWidth (int plane) const noexcept |
Width of plane accounting for chroma subsampling. | |
| int | PlaneHeight (int plane) const noexcept |
Height of plane accounting for chroma subsampling. | |
| int | BitsPerComponent () const noexcept |
| Bits per component from the pixel descriptor. | |
| const char * | FormatName () const noexcept |
| Pixel or sample format name. | |
| const uint8_t * | Data (int plane) const noexcept |
Const pointer to plane plane. | |
| uint8_t * | Data (int plane) noexcept |
Mutable pointer to plane plane. | |
| int | Linesize (int plane) const noexcept |
Bytes per row for plane, including padding. | |
| int | NbSamples () const noexcept |
| Audio sample count. | |
| void | NbSamples (int samples) noexcept |
| Sets audio sample count. | |
| int | SampleRate () const noexcept |
| Audio sample rate in Hz. | |
| void | SampleRate (int rate) noexcept |
| Sets audio sample rate. | |
| int | Channels () const noexcept |
| Audio channel count. | |
| AVChannelLayout | ChannelLayout () const noexcept |
| Channel layout owned by this frame. | |
| bool | CopyChannelLayout (const AVChannelLayout &layout) noexcept |
| Replaces the channel layout. | |
| uint8_t ** | ExtendedData () noexcept |
Planar audio / video data pointers (extended_data). | |
| const uint8_t *const * | ExtendedData () const noexcept |
Const planar data pointers (extended_data). | |
| const AVFrameSideData * | SideData (int type) const noexcept |
| Looks up side data. | |
| AVFrameSideData * | SideData (int type) noexcept |
| Looks up mutable side data. | |
| void | RemoveSideData (int type) noexcept |
Removes side data of type. | |
| int | SideDataCount () const noexcept |
| Number of side-data entries. | |
| const AVFrameSideData * | SideDataAt (int index) const noexcept |
Side data at index. | |
| uint8_t * | NewSideData (int type, int size) noexcept |
Allocates side data of type (av_frame_new_side_data). | |
| void | CopyPrimaryBuffer (StormByte::Buffer::DataType &out) const noexcept |
Packs planar video/audio into out without linesize padding. | |
| void | WriteHdr10 (const StormByte::Multimedia::Property::HDR10 &hdr10) noexcept |
Writes mastering display and content light from hdr10. | |
| void | WriteSideData (const std::vector< StormByte::Multimedia::Pipeline::SideData > &attachments) noexcept |
| Copies raw SEI/side-data blobs onto the frame. | |
| bool | ScaleTo (AVFrame &dst, int dst_w, int dst_h, int flags=0) const noexcept |
Scales this frame into dst (allocates dst if empty). | |
| void | Reset (::AVFrame *raw) noexcept |
Adopts raw. | |
Public Member Functions inherited from StormByte::Multimedia::FFmpeg::AVPointer<::AVFrame > | |
| constexpr | AVPointer () noexcept=delete |
| Default constructor (deleted). | |
| constexpr | AVPointer (const AVPointer &) noexcept=delete |
| Copy constructor (deleted). | |
| constexpr | AVPointer (AVPointer &&other) noexcept |
| Move constructor. | |
| virtual | ~AVPointer () noexcept=default |
| Destructor. | |
| constexpr AVPointer & | operator= (const AVPointer &) noexcept=delete |
| Copy assignment (deleted). | |
| constexpr AVPointer & | operator= (AVPointer &&other) noexcept |
| Move assignment. | |
Static Public Member Functions | |
| static int | FormatNone () noexcept |
AV_PIX_FMT_NONE as int. | |
| static int | FormatGray8 () noexcept |
AV_PIX_FMT_GRAY8 as int. | |
| static int | FormatRgba () noexcept |
AV_PIX_FMT_RGBA as int. | |
| static AVFrame | DecodeImage (const std::uint8_t *data, std::size_t size, std::string_view hint={}) noexcept |
| Decodes one still image from a compressed buffer. | |
Friends | |
| class | AVDecoder |
| class | AVEncoder |
| class | Swr |
| class | Sws |
| class | StormByte::Multimedia::Backend::Pipeline::Frame |
| class | StormByte::Multimedia::Pipeline::Filter::FFmpeg |
Additional Inherited Members | |
Protected Member Functions inherited from StormByte::Multimedia::FFmpeg::AVPointer<::AVFrame > | |
| constexpr | AVPointer (std::decay_t< ::AVFrame > *ptr) noexcept |
Adopts ptr. | |
| constexpr const std::decay_t< ::AVFrame > * | Get () const noexcept |
| Const view of the raw FFmpeg pointer. | |
| constexpr std::decay_t< ::AVFrame > * | Get () noexcept |
| Mutable view of the raw FFmpeg pointer. | |
| constexpr std::decay_t< ::AVFrame > * | Detach () noexcept |
| Yields the raw pointer and leaves this wrapper empty. | |
Protected Attributes inherited from StormByte::Multimedia::FFmpeg::AVPointer<::AVFrame > | |
| std::decay_t< ::AVFrame > * | m_ptr |
| Owned FFmpeg pointer. | |
RAII owner of a libav AVFrame.
Filter authors: clone, scale, planes, props, side data, still-image decode. Do not call av_*. Get() and Detach() are not public.
|
strong |
Planar video family, ignoring bit depth.
Packed RGB/YUV and hardware formats are Unknown. Gray is single-component (YUV400 for libvmaf).
| Enumerator | |
|---|---|
| Unknown | Not a software planar YUV/gray frame. |
| Gray | One component (GRAY8 / GRAY10 / …). |
| Yuv420 | 4:2:0 (8 / 10 / 12). |
| Yuv422 | 4:2:2 (8 / 10). |
| Yuv444 | 4:4:4 (8 / 10). |
|
noexcept |
Allocates an empty frame (av_frame_alloc).
|
defaultnoexcept |
Move constructor.
Transfers the libav pointer.
| other | Source frame; left empty. |
|
overridenoexcept |
Destructor.
Unreferences buffers and frees the struct.
|
noexcept |
Sets audio samples, format and layout, then allocates planes.
| nb_samples | Sample count. |
| format | AVSampleFormat as int. |
| layout | Channel layout. |
| sample_rate | Sample rate in Hz. |
|
noexcept |
Sets video geometry and format, then allocates planes.
| width | Width in pixels. |
| height | Height in pixels. |
| format | AVPixelFormat as int. |
| align | Alignment in bytes. 0 = FFmpeg default. |
|
noexcept |
Applies the crop window (av_frame_apply_cropping).
| flags | AV_FRAME_CROP_* flags. |
|
noexcept |
Best-effort timestamp (best_effort_timestamp).
|
noexcept |
Sets the best-effort timestamp.
| ts | Timestamp, or AV_NOPTS_VALUE. |
|
noexcept |
Bits per component from the pixel descriptor.
|
noexcept |
Channel layout owned by this frame.
|
noexcept |
Audio channel count.
|
noexcept |
Chroma sample location.
AVChromaLocation as int.
|
noexcept |
Sets chroma sample location.
| location | AVChromaLocation as int. |
|
noexcept |
Independent clone (av_frame_clone).
|
noexcept |
Color primaries.
AVColorPrimaries as int.
|
noexcept |
Sets color primaries.
| primaries | AVColorPrimaries as int. |
|
noexcept |
Color range.
AVColorRange as int.
|
noexcept |
Sets color range.
| range | AVColorRange as int. |
|
noexcept |
Matrix coefficients.
AVColorSpace as int.
|
noexcept |
Sets matrix coefficients.
| space | AVColorSpace as int. |
|
noexcept |
Transfer characteristics.
AVColorTransferCharacteristic as int.
|
noexcept |
Sets transfer characteristics.
| transfer | AVColorTransferCharacteristic as int. |
|
noexcept |
Copies samples/planes from other (av_frame_copy).
| other | Source with matching geometry. |
|
noexcept |
Replaces the channel layout.
| layout | Source layout. |
|
noexcept |
Packs planar video/audio into out without linesize padding.
| out | Destination (cleared first). |
|
noexcept |
Copies metadata from other (av_frame_copy_props).
| other | Source frame. |
|
noexcept |
Sets crop window.
Does not apply it.
| left | Left crop in pixels. |
| right | Right crop in pixels. |
| top | Top crop in pixels. |
| bottom | Bottom crop in pixels. |
|
noexcept |
Bottom crop in pixels.
|
noexcept |
Left crop in pixels.
|
noexcept |
Right crop in pixels.
|
noexcept |
Top crop in pixels.
|
noexcept |
Const pointer to plane plane.
| plane | Plane index. |
|
noexcept |
Mutable pointer to plane plane.
| plane | Plane index. |
|
staticnoexcept |
Decodes one still image from a compressed buffer.
| data | File bytes (PNG / JPEG / WebP / BMP). |
| size | Byte count. |
| hint | Path or extension (.png, logo.jpg). Empty tries JPEG. |
!frame) on failure.Opens a decoder, sends one packet, receives one frame. Does not convert pixel format; call ScaleTo for RGBA / GRAY8. data must remain valid for the duration of the call.
|
noexcept |
Duration in stream ticks.
|
noexcept |
Sets duration in stream ticks.
| duration | Duration, or 0. |
|
noexcept |
Const planar data pointers (extended_data).
|
noexcept |
Planar audio / video data pointers (extended_data).
|
noexcept |
Pixel or sample format.
AV_PIX_FMT_NONE.
|
noexcept |
Sets pixel or sample format.
Does not reallocate planes.
| format | Format as int. |
|
staticnoexcept |
AV_PIX_FMT_GRAY8 as int.
|
noexcept |
Pixel or sample format name.
"?".
|
staticnoexcept |
AV_PIX_FMT_NONE as int.
|
staticnoexcept |
AV_PIX_FMT_RGBA as int.
|
noexcept |
Allocates plane buffers (av_frame_get_buffer).
| align | Alignment in bytes. 0 = FFmpeg default. |
|
noexcept |
Whether the pixel format is hardware-backed.
|
noexcept |
Frame height in pixels.
|
noexcept |
Sets frame height.
Does not reallocate planes.
| height | Height in pixels. |
|
noexcept |
Whether the frame is interlaced.
|
noexcept |
Marks the frame as interlaced or progressive.
| interlaced | true for interlaced. |
| top_first | true if the top field is first. |
|
noexcept |
Whether this is a key frame.
|
noexcept |
Marks the frame as a key frame or not.
| key | true for a key frame. |
|
noexcept |
Planar layout of this frame.
Unknown if empty / packed / hw.
|
noexcept |
Bytes per row for plane, including padding.
| plane | Plane index. |
|
noexcept |
Ensures unique buffers (av_frame_make_writable).
|
noexcept |
Audio sample count.
|
noexcept |
Sets audio sample count.
Does not reallocate.
| samples | Sample count. |
|
noexcept |
Allocates side data of type (av_frame_new_side_data).
| type | AVFrameSideDataType value. |
| size | Payload size in bytes. |
|
explicitnoexcept |
True when a libav struct is owned.
Plane buffers may still be empty.
Move assignment.
Frees *this, then takes other.
| other | Source frame; left empty. |
|
noexcept |
Picture type (I/P/B/…).
AVPictureType as int.
|
noexcept |
Sets picture type.
| type | AVPictureType as int. |
|
noexcept |
Number of video components or audio channels.
|
noexcept |
Height of plane accounting for chroma subsampling.
| plane | Plane index. 0 is luma / packed. |
|
noexcept |
Width of plane accounting for chroma subsampling.
| plane | Plane index. 0 is luma / packed. |
|
noexcept |
Presentation timestamp in stream ticks.
|
noexcept |
Sets presentation timestamp in stream ticks.
| pts | Presentation timestamp, or AV_NOPTS_VALUE. |
|
noexcept |
Shares buffers with other (av_frame_ref).
| other | Source frame. |
|
noexcept |
Removes side data of type.
| type | AVFrameSideDataType value. |
|
noexcept |
Extra delay in field durations (repeat_pict).
Yadif / bwdif.
|
noexcept |
Sets repeat_pict.
| repeat | Extra field delays. |
|
noexcept |
Adopts raw.
Previous frame is freed.
| raw | libav frame, or nullptr. |
|
noexcept |
Sample aspect ratio.
{0, 1} if unknown.
|
noexcept |
Sets sample aspect ratio.
| sar | Pixel aspect ratio. |
|
noexcept |
Audio sample rate in Hz.
|
noexcept |
Sets audio sample rate.
| rate | Sample rate in Hz. |
|
noexcept |
Scales this frame into dst (allocates dst if empty).
| dst | Destination. Pixel format is taken from dst if set, otherwise from this frame. |
| dst_w | Destination width. |
| dst_h | Destination height. |
| flags | libswscale flags. 0 = SWS_BILINEAR. |
|
noexcept |
Looks up side data.
| type | AVFrameSideDataType value. |
|
noexcept |
Looks up mutable side data.
| type | AVFrameSideDataType value. |
|
noexcept |
Side data at index.
| index | Entry index. |
|
noexcept |
Number of side-data entries.
|
noexcept |
Whether the top field is first (interlaced).
|
noexcept |
Unreferences frame buffers (av_frame_unref).
|
noexcept |
Frame width in pixels.
|
noexcept |
Sets frame width.
Does not reallocate planes.
| width | Width in pixels. |
|
noexcept |
Whether plane buffers are uniquely owned.
|
noexcept |
Writes mastering display and content light from hdr10.
| hdr10 | High-level HDR10 bag. |
|
noexcept |
Copies raw SEI/side-data blobs onto the frame.
| attachments | High-level side data. |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |