FFmpeg
Data Structures | Functions | Variables
ffmpeg_dec.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/dict.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec.h"
#include "libavfilter/buffersrc.h"
#include "ffmpeg.h"
#include "ffmpeg_utils.h"
#include "thread_queue.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 int dec_alloc (DecoderPriv **pdec)
 
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)
 
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 void dec_thread_set_name (const DecoderPriv *dp)
 
static void dec_thread_uninit (DecThreadContext *dt)
 
static int dec_thread_init (DecThreadContext *dt)
 
static void * decoder_thread (void *arg)
 
static enum AVPixelFormat get_format (AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
 
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)
 
static const char * dec_item_name (void *obj)
 
int dec_open (Decoder **pdec, Scheduler *sch, AVDictionary **dec_opts, const DecoderOpts *o)
 
int dec_add_filter (Decoder *dec, InputFilter *ifilter)
 

Variables

static const AVClass dec_class
 

Function Documentation

◆ dp_from_dec()

static DecoderPriv* dp_from_dec ( Decoder d)
static

Definition at line 79 of file ffmpeg_dec.c.

Referenced by dec_add_filter(), and dec_free().

◆ dec_free()

void dec_free ( Decoder **  pdec)

Definition at line 90 of file ffmpeg_dec.c.

Referenced by dec_alloc(), dec_open(), and ist_free().

◆ dec_alloc()

static int dec_alloc ( DecoderPriv **  pdec)
static

Definition at line 113 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ audio_samplerate_update()

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

Definition at line 144 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 187 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 224 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 276 of file ffmpeg_dec.c.

Referenced by video_frame_process().

◆ video_frame_process()

static int video_frame_process ( DecoderPriv dp,
AVFrame frame 
)
static

Definition at line 318 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 374 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 454 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 461 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 494 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 537 of file ffmpeg_dec.c.

Referenced by ost_add(), and transcode_subtitles().

◆ transcode_subtitles()

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

Definition at line 559 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 617 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 733 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_thread_uninit()

static void dec_thread_uninit ( DecThreadContext dt)
static

Definition at line 741 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 749 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ decoder_thread()

static void* decoder_thread ( void *  arg)
static

Definition at line 768 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ get_format()

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

Definition at line 866 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 900 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 916 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ dec_item_name()

static const char* dec_item_name ( void *  obj)
static

Definition at line 1045 of file ffmpeg_dec.c.

◆ dec_open()

int dec_open ( Decoder **  pdec,
Scheduler sch,
AVDictionary **  dec_opts,
const DecoderOpts o 
)
Parameters
dec_optsDictionary filled with decoder options. Its ownership is transferred to the decoder.
Return values
>=0non-negative scheduler index on success
<0an error code on failure

Definition at line 1059 of file ffmpeg_dec.c.

Referenced by ist_use().

◆ dec_add_filter()

int dec_add_filter ( Decoder dec,
InputFilter ifilter 
)

Definition at line 1164 of file ffmpeg_dec.c.

Referenced by ist_filter_add().

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 1052 of file ffmpeg_dec.c.

Referenced by dec_open().

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