FFmpegfs Fuse Multi Media Filesystem 2.16
Public Member Functions | Public Attributes | Protected Attributes | List of all members
FFmpeg_Frame Class Reference

The FFmpeg_Frame class. More...

#include <ffmpeg_frame.h>

Public Member Functions

 FFmpeg_Frame (int stream_index=INVALID_STREAM)
 Construct FFmpeg_Frame object. More...
 
 FFmpeg_Frame (const FFmpeg_Frame &frame)
 Copy construct from FFmpeg_Frame object. More...
 
 FFmpeg_Frame (const AVFrame *frame)
 Copy construct from AVFrame struct. More...
 
virtual ~FFmpeg_Frame ()
 Destruct FFmpeg_Frame object. More...
 
int res () const
 Get result of last operation. More...
 
AVFrame * clone ()
 Clone frame to a new AVFrame * struct. Needs to be freed by a av_frame_free() call. More...
 
void unref ()
 Unreference underlying frame. More...
 
void free ()
 Free underlying frame. More...
 
AVFrame * get ()
 Access the underlying frame. More...
 
 operator AVFrame * ()
 operator AVFrame *: Do as if we were a pointer to AVFrame More...
 
 operator const AVFrame * () const
 operator const AVFrame *: Do as if we were a const pointer to AVFrame More...
 
AVFrame * operator-> ()
 operator ->: Do as if we were a pointer to AVFrame More...
 
FFmpeg_Frameoperator= (const FFmpeg_Frame &frame) noexcept
 Make copy from other FFmpeg_Frame object. More...
 
FFmpeg_Frameoperator= (const AVFrame *frame) noexcept
 Make copy from AVFrame structure. More...
 

Public Attributes

int m_stream_idx
 Stream index frame belongs to, or -1 (INVALID_STREAM) More...
 

Protected Attributes

AVFrame * m_frame
 Pointer to underlying AVFrame struct. More...
 
int m_res
 0 if last operation was successful, or negative AVERROR value More...
 

Detailed Description

The FFmpeg_Frame class.

Definition at line 42 of file ffmpeg_frame.h.

Constructor & Destructor Documentation

◆ FFmpeg_Frame() [1/3]

FFmpeg_Frame::FFmpeg_Frame ( int  stream_index = INVALID_STREAM)
explicit

Construct FFmpeg_Frame object.

Parameters
[in]stream_index- Index of stream

Definition at line 48 of file ffmpeg_frame.cc.

References m_frame, and m_res.

◆ FFmpeg_Frame() [2/3]

FFmpeg_Frame::FFmpeg_Frame ( const FFmpeg_Frame frame)

Copy construct from FFmpeg_Frame object.

Parameters
[in]frame- Pointer to source FFmpeg_Frame object.
Note
Do not declare explicit, breaks use in std::variant

Definition at line 56 of file ffmpeg_frame.cc.

References m_frame, and m_res.

◆ FFmpeg_Frame() [3/3]

FFmpeg_Frame::FFmpeg_Frame ( const AVFrame *  frame)

Copy construct from AVFrame struct.

Parameters
[in]frame- Pointer to source AVFrame struct.
Note
Do not declare explicit, breaks use in std::variant

Definition at line 73 of file ffmpeg_frame.cc.

References m_frame, and m_res.

◆ ~FFmpeg_Frame()

FFmpeg_Frame::~FFmpeg_Frame ( )
virtual

Destruct FFmpeg_Frame object.

Definition at line 90 of file ffmpeg_frame.cc.

References free().

Member Function Documentation

◆ clone()

AVFrame * FFmpeg_Frame::clone ( )

Clone frame to a new AVFrame * struct. Needs to be freed by a av_frame_free() call.

Returns
Returns cloned AVFrame * struct, or nullptr on error.

Definition at line 95 of file ffmpeg_frame.cc.

References m_frame.

◆ free()

void FFmpeg_Frame::free ( )

Free underlying frame.

Definition at line 108 of file ffmpeg_frame.cc.

References m_frame.

Referenced by ~FFmpeg_Frame().

◆ get()

AVFrame * FFmpeg_Frame::get ( )

Access the underlying frame.

Returns
Returns the unerlying AVFrame * struct, or nullptr not valid.

Definition at line 122 of file ffmpeg_frame.cc.

References m_frame.

◆ operator AVFrame *()

FFmpeg_Frame::operator AVFrame * ( )

operator AVFrame *: Do as if we were a pointer to AVFrame

Definition at line 127 of file ffmpeg_frame.cc.

◆ operator const AVFrame *()

FFmpeg_Frame::operator const AVFrame * ( ) const

operator const AVFrame *: Do as if we were a const pointer to AVFrame

Definition at line 132 of file ffmpeg_frame.cc.

◆ operator->()

AVFrame * FFmpeg_Frame::operator-> ( )

operator ->: Do as if we were a pointer to AVFrame

Returns
Pointer to AVFrame struct.

Definition at line 137 of file ffmpeg_frame.cc.

References m_frame.

◆ operator=() [1/2]

FFmpeg_Frame & FFmpeg_Frame::operator= ( const AVFrame *  frame)
noexcept

Make copy from AVFrame structure.

Parameters
[in]frame- Pointer to source AVFrame structure.
Returns
Reference to new FFmpeg_Frame object.

Definition at line 161 of file ffmpeg_frame.cc.

References INVALID_STREAM.

◆ operator=() [2/2]

FFmpeg_Frame & FFmpeg_Frame::operator= ( const FFmpeg_Frame frame)
noexcept

Make copy from other FFmpeg_Frame object.

Parameters
[in]frame- Reference to source FFmpeg_Frame object.
Returns
Reference to new FFmpeg_Frame object.

Definition at line 142 of file ffmpeg_frame.cc.

◆ res()

int FFmpeg_Frame::res ( ) const

Get result of last operation.

Returns
Returns 0 if last operation was successful, or negative AVERROR value.

Definition at line 117 of file ffmpeg_frame.cc.

References m_res.

Referenced by FFmpeg_Transcoder::create_audio_frame(), FFmpeg_Transcoder::decode_audio_frame(), FFmpeg_Transcoder::decode_video_frame(), FFmpeg_Transcoder::encode_image_frame(), FFmpeg_Transcoder::encode_video_frame(), and FFmpeg_Transcoder::send_filters().

◆ unref()

void FFmpeg_Frame::unref ( )

Unreference underlying frame.

Definition at line 100 of file ffmpeg_frame.cc.

References m_frame.

Member Data Documentation

◆ m_frame

AVFrame* FFmpeg_Frame::m_frame
protected

Pointer to underlying AVFrame struct.

Definition at line 117 of file ffmpeg_frame.h.

Referenced by clone(), FFmpeg_Frame(), free(), get(), operator->(), and unref().

◆ m_res

int FFmpeg_Frame::m_res
protected

0 if last operation was successful, or negative AVERROR value

Definition at line 118 of file ffmpeg_frame.h.

Referenced by FFmpeg_Frame(), and res().

◆ m_stream_idx

int FFmpeg_Frame::m_stream_idx

Stream index frame belongs to, or -1 (INVALID_STREAM)

Definition at line 121 of file ffmpeg_frame.h.

Referenced by FFmpeg_Transcoder::process_single_fr(), and FFmpeg_Transcoder::send_filters().


The documentation for this class was generated from the following files: