avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
frame.h File Reference

Video frames, audio samples and their common frame interface.

#include <vector>
#include "avcompat.h"
#include "avcpp/buffer.h"
#include "avcpp/dictionary.h"
#include "ffmpeg.h"
#include "hwcontext.h"
#include "rational.h"
#include "timestamp.h"
#include "pixelformat.h"
#include "sampleformat.h"
#include <libavutil/hwcontext.h>
#include <libavutil/imgutils.h>
#include <libavutil/attributes.h>

Go to the source code of this file.

Classes

class  av::FrameSideData
 Simple view for the AVFrameSideData elements. More...
class  av::FrameCommon
 Common interface of video frames and audio samples. More...
struct  av::FrameCommon::wrap_data
 Wrap data and take owning. More...
struct  av::FrameCommon::wrap_data_static
 Wrap static data, do not owning and free. More...
class  av::Frame< T >
 CRTP base that gives a frame type its copy and move assignment. More...
class  av::VideoFrame
 One video frame. More...
class  av::AudioSamples
 One buffer of decoded audio samples. More...

Namespaces

namespace  av
 Root namespace of the library.

Functions

int64_t av::frame::get_best_effort_timestamp (const AVFrame *frame)
 Timestamp FFmpeg considers the best estimate of the presentation time.
uint64_t av::frame::get_channel_layout (const AVFrame *frame)
 Channel layout of a frame as a bit mask.
void av::frame::set_channel_layout (AVFrame *frame, uint64_t layout)
 Set the channel layout of a frame from a bit mask.

Function Documentation

◆ get_best_effort_timestamp()

int64_t av::frame::get_best_effort_timestamp ( const AVFrame * frame)

Falls back from pts to best_effort_timestamp and then to pkt_dts, in the order FFmpeg itself uses.

Parameters
framethe frame to inspect
Returns
the timestamp, or AV_NOPTS_VALUE when the frame carries none

◆ get_channel_layout()

uint64_t av::frame::get_channel_layout ( const AVFrame * frame)

Bridges the old bit-mask layout and the AVChannelLayout API, so callers do not have to care which one the FFmpeg build uses.

Parameters
framethe frame to inspect
Returns
an AV_CH_LAYOUT_* mask, or zero when the frame has none

◆ set_channel_layout()

void av::frame::set_channel_layout ( AVFrame * frame,
uint64_t layout )
Parameters
framethe frame to modify; must not be null
layoutan AV_CH_LAYOUT_* mask