FFmpeg
Data Structures | Functions | Variables
ffmpeg_dec.c File Reference
#include <stdbit.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/stereo3d.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec.h"
#include "ffmpeg.h"

Go to the source code of this file.

Data Structures

struct  DecoderPriv
 
struct  DecThreadContext
 

Functions

static DecoderPrivdp_from_dec (Decoder *d)
 
void dec_free (Decoder **pdec)
 
static const char * dec_item_name (void *obj)
 
static int decoder_thread (void *arg)
 
static int dec_alloc (DecoderPriv **pdec, Scheduler *sch, int send_end_ts)
 
static AVRational audio_samplerate_update (DecoderPriv *dp, const AVFrame *frame)
 
static void audio_ts_process (DecoderPriv *dp, AVFrame *frame)
 
static int64_t video_duration_estimate (const DecoderPriv *dp, const AVFrame *frame)
 
static int hwaccel_retrieve_data (AVCodecContext *avctx, AVFrame *input)
 
static int video_frame_process (DecoderPriv *dp, AVFrame *frame, unsigned *outputs_mask)
 
static int copy_av_subtitle (AVSubtitle *dst, const AVSubtitle *src)
 
static void subtitle_free (void *opaque, uint8_t *data)
 
static int subtitle_wrap_frame (AVFrame *frame, AVSubtitle *subtitle, int copy)
 
static int process_subtitle (DecoderPriv *dp, AVFrame *frame)
 
static int fix_sub_duration_heartbeat (DecoderPriv *dp, int64_t signal_pts)
 
static int transcode_subtitles (DecoderPriv *dp, const AVPacket *pkt, AVFrame *frame)
 
static int packet_decode (DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
 
static int dec_open (DecoderPriv *dp, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
 
static int dec_standalone_open (DecoderPriv *dp, const AVPacket *pkt)
 
static void dec_thread_set_name (const DecoderPriv *dp)
 
static void dec_thread_uninit (DecThreadContext *dt)
 
static int dec_thread_init (DecThreadContext *dt)
 
int dec_request_view (Decoder *d, const ViewSpecifier *vs, SchedulerNode *src)
 
static int multiview_setup (DecoderPriv *dp, AVCodecContext *dec_ctx)
 
static void multiview_check_manual (DecoderPriv *dp, const AVDictionary *dec_opts)
 
static enum AVPixelFormat get_format (AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
 
static int get_buffer (AVCodecContext *dec_ctx, AVFrame *frame, int flags)
 
static HWDevicehw_device_match_by_codec (const AVCodec *codec)
 
static int hw_device_setup_for_decode (DecoderPriv *dp, const AVCodec *codec, const char *hwaccel_device)
 
int dec_init (Decoder **pdec, Scheduler *sch, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
 
int dec_create (const OptionsContext *o, const char *arg, Scheduler *sch)
 Create a standalone decoder. More...
 
int dec_filter_add (Decoder *d, InputFilter *ifilter, InputFilterOptions *opts, const ViewSpecifier *vs, SchedulerNode *src)
 

Variables

static const AVClass dec_class
 

Function Documentation

◆ dp_from_dec()

static DecoderPriv* dp_from_dec ( Decoder d)
static

Definition at line 107 of file ffmpeg_dec.c.

Referenced by dec_filter_add(), dec_free(), and dec_request_view().

◆ dec_free()

void dec_free ( Decoder **  pdec)

Definition at line 118 of file ffmpeg_dec.c.

Referenced by dec_alloc(), dec_create(), dec_init(), ffmpeg_cleanup(), and ist_free().

◆ dec_item_name()

static const char* dec_item_name ( void *  obj)
static

Definition at line 147 of file ffmpeg_dec.c.

◆ decoder_thread()

static int decoder_thread ( void *  arg)
static

Definition at line 912 of file ffmpeg_dec.c.

Referenced by dec_alloc().

◆ dec_alloc()

static int dec_alloc ( DecoderPriv **  pdec,
Scheduler sch,
int  send_end_ts 
)
static

Definition at line 163 of file ffmpeg_dec.c.

Referenced by dec_create(), and dec_init().

◆ audio_samplerate_update()

static AVRational audio_samplerate_update ( DecoderPriv dp,
const AVFrame frame 
)
static

Definition at line 203 of file ffmpeg_dec.c.

Referenced by audio_ts_process().

◆ audio_ts_process()

static void audio_ts_process ( DecoderPriv dp,
AVFrame frame 
)
static

Definition at line 246 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ video_duration_estimate()

static int64_t video_duration_estimate ( const DecoderPriv dp,
const AVFrame frame 
)
static

Definition at line 283 of file ffmpeg_dec.c.

Referenced by video_frame_process().

◆ hwaccel_retrieve_data()

static int hwaccel_retrieve_data ( AVCodecContext avctx,
AVFrame input 
)
static

Definition at line 343 of file ffmpeg_dec.c.

Referenced by video_frame_process().

◆ video_frame_process()

static int video_frame_process ( DecoderPriv dp,
AVFrame frame,
unsigned *  outputs_mask 
)
static

Definition at line 385 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ copy_av_subtitle()

static int copy_av_subtitle ( AVSubtitle dst,
const AVSubtitle src 
)
static

Definition at line 454 of file ffmpeg_dec.c.

Referenced by subtitle_wrap_frame().

◆ subtitle_free()

static void subtitle_free ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 534 of file ffmpeg_dec.c.

Referenced by subtitle_wrap_frame().

◆ subtitle_wrap_frame()

static int subtitle_wrap_frame ( AVFrame frame,
AVSubtitle subtitle,
int  copy 
)
static

Definition at line 541 of file ffmpeg_dec.c.

Referenced by fix_sub_duration_heartbeat(), and transcode_subtitles().

◆ process_subtitle()

static int process_subtitle ( DecoderPriv dp,
AVFrame frame 
)
static

Definition at line 574 of file ffmpeg_dec.c.

Referenced by fix_sub_duration_heartbeat(), and transcode_subtitles().

◆ fix_sub_duration_heartbeat()

static int fix_sub_duration_heartbeat ( DecoderPriv dp,
int64_t  signal_pts 
)
static

Definition at line 617 of file ffmpeg_dec.c.

Referenced by transcode_subtitles().

◆ transcode_subtitles()

static int transcode_subtitles ( DecoderPriv dp,
const AVPacket pkt,
AVFrame frame 
)
static

Definition at line 639 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ packet_decode()

static int packet_decode ( DecoderPriv dp,
AVPacket pkt,
AVFrame frame 
)
static

Definition at line 697 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_open()

static int dec_open ( DecoderPriv dp,
AVDictionary **  dec_opts,
const DecoderOpts o,
AVFrame param_out 
)
static

Definition at line 1522 of file ffmpeg_dec.c.

Referenced by dec_init(), and dec_standalone_open().

◆ dec_standalone_open()

static int dec_standalone_open ( DecoderPriv dp,
const AVPacket pkt 
)
static

Definition at line 835 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_thread_set_name()

static void dec_thread_set_name ( const DecoderPriv dp)
static

Definition at line 870 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_thread_uninit()

static void dec_thread_uninit ( DecThreadContext dt)
static

Definition at line 885 of file ffmpeg_dec.c.

Referenced by dec_thread_init(), and decoder_thread().

◆ dec_thread_init()

static int dec_thread_init ( DecThreadContext dt)
static

Definition at line 893 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_request_view()

int dec_request_view ( Decoder d,
const ViewSpecifier vs,
SchedulerNode src 
)

Definition at line 1026 of file ffmpeg_dec.c.

Referenced by dec_filter_add(), and ist_use().

◆ multiview_setup()

static int multiview_setup ( DecoderPriv dp,
AVCodecContext dec_ctx 
)
static

Definition at line 1089 of file ffmpeg_dec.c.

Referenced by get_format().

◆ multiview_check_manual()

static void multiview_check_manual ( DecoderPriv dp,
const AVDictionary dec_opts 
)
static

Definition at line 1306 of file ffmpeg_dec.c.

Referenced by dec_create(), and dec_init().

◆ get_format()

static enum AVPixelFormat get_format ( AVCodecContext s,
const enum AVPixelFormat pix_fmts 
)
static

Definition at line 1315 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ get_buffer()

static int get_buffer ( AVCodecContext dec_ctx,
AVFrame frame,
int  flags 
)
static

Definition at line 1357 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ hw_device_match_by_codec()

static HWDevice* hw_device_match_by_codec ( const AVCodec codec)
static

Definition at line 1377 of file ffmpeg_dec.c.

Referenced by hw_device_setup_for_decode().

◆ hw_device_setup_for_decode()

static int hw_device_setup_for_decode ( DecoderPriv dp,
const AVCodec codec,
const char *  hwaccel_device 
)
static

Definition at line 1393 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ dec_init()

int dec_init ( Decoder **  pdec,
Scheduler sch,
AVDictionary **  dec_opts,
const DecoderOpts o,
AVFrame param_out 
)
Parameters
dec_optsDictionary filled with decoder options. Its ownership is transferred to the decoder.
param_outIf non-NULL, media properties after opening the decoder are written here.
Return values
>=0non-negative scheduler index on success
<0an error code on failure

Definition at line 1647 of file ffmpeg_dec.c.

Referenced by ist_use().

◆ dec_create()

int dec_create ( const OptionsContext o,
const char *  arg,
Scheduler sch 
)

Create a standalone decoder.

Definition at line 1674 of file ffmpeg_dec.c.

◆ dec_filter_add()

int dec_filter_add ( Decoder d,
InputFilter ifilter,
InputFilterOptions opts,
const ViewSpecifier vs,
SchedulerNode src 
)

Definition at line 1748 of file ffmpeg_dec.c.

Referenced by ifilter_bind_dec().

Variable Documentation

◆ dec_class

const AVClass dec_class
static
Initial value:
= {
.class_name = "Decoder",
.parent_log_context_offset = 0x42,
.item_name = dec_item_name,
}

Definition at line 154 of file ffmpeg_dec.c.

Referenced by dec_alloc().

dec_item_name
static const char * dec_item_name(void *obj)
Definition: ffmpeg_dec.c:147
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85