FFmpeg
Data Structures | Functions
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/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec.h"
#include "libavfilter/buffersrc.h"
#include "ffmpeg.h"
#include "thread_queue.h"

Go to the source code of this file.

Data Structures

struct  Decoder
 
struct  DecThreadContext
 

Functions

static int dec_thread_stop (Decoder *d)
 
void dec_free (Decoder **pdec)
 
static int dec_alloc (Decoder **pdec)
 
static int send_frame_to_filters (InputStream *ist, AVFrame *decoded_frame)
 
static AVRational audio_samplerate_update (void *logctx, Decoder *d, const AVFrame *frame)
 
static void audio_ts_process (void *logctx, Decoder *d, AVFrame *frame)
 
static int64_t video_duration_estimate (const InputStream *ist, const AVFrame *frame)
 
static int video_frame_process (InputStream *ist, AVFrame *frame)
 
static void sub2video_flush (InputStream *ist)
 
static int process_subtitle (InputStream *ist, AVFrame *frame)
 
int fix_sub_duration_heartbeat (InputStream *ist, int64_t signal_pts)
 
static int transcode_subtitles (InputStream *ist, const AVPacket *pkt, AVFrame *frame)
 
static int send_filter_eof (InputStream *ist)
 
static int packet_decode (InputStream *ist, AVPacket *pkt, AVFrame *frame)
 
static void dec_thread_set_name (const InputStream *ist)
 
static void dec_thread_uninit (DecThreadContext *dt)
 
static int dec_thread_init (DecThreadContext *dt)
 
static void * decoder_thread (void *arg)
 
int dec_packet (InputStream *ist, const AVPacket *pkt, int no_eof)
 Submit a packet for decoding. More...
 
static int dec_thread_start (InputStream *ist)
 
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 (InputStream *ist)
 
int dec_open (InputStream *ist)
 

Function Documentation

◆ dec_thread_stop()

static int dec_thread_stop ( Decoder d)
static

Definition at line 79 of file ffmpeg_dec.c.

Referenced by dec_free(), and dec_packet().

◆ dec_free()

void dec_free ( Decoder **  pdec)

Definition at line 97 of file ffmpeg_dec.c.

Referenced by dec_alloc(), and ist_free().

◆ dec_alloc()

static int dec_alloc ( Decoder **  pdec)
static

Definition at line 116 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ send_frame_to_filters()

static int send_frame_to_filters ( InputStream ist,
AVFrame decoded_frame 
)
static

Definition at line 147 of file ffmpeg_dec.c.

Referenced by dec_packet().

◆ audio_samplerate_update()

static AVRational audio_samplerate_update ( void *  logctx,
Decoder d,
const AVFrame frame 
)
static

Definition at line 165 of file ffmpeg_dec.c.

Referenced by audio_ts_process().

◆ audio_ts_process()

static void audio_ts_process ( void *  logctx,
Decoder d,
AVFrame frame 
)
static

Definition at line 208 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ video_duration_estimate()

static int64_t video_duration_estimate ( const InputStream ist,
const AVFrame frame 
)
static

Definition at line 245 of file ffmpeg_dec.c.

Referenced by video_frame_process().

◆ video_frame_process()

static int video_frame_process ( InputStream ist,
AVFrame frame 
)
static

Definition at line 297 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ sub2video_flush()

static void sub2video_flush ( InputStream ist)
static

Definition at line 382 of file ffmpeg_dec.c.

Referenced by dec_packet().

◆ process_subtitle()

static int process_subtitle ( InputStream ist,
AVFrame frame 
)
static

Definition at line 391 of file ffmpeg_dec.c.

Referenced by dec_packet(), and fix_sub_duration_heartbeat().

◆ fix_sub_duration_heartbeat()

int fix_sub_duration_heartbeat ( InputStream ist,
int64_t  signal_pts 
)

Definition at line 454 of file ffmpeg_dec.c.

Referenced by ost_add(), and trigger_fix_sub_duration_heartbeat().

◆ transcode_subtitles()

static int transcode_subtitles ( InputStream ist,
const AVPacket pkt,
AVFrame frame 
)
static

Definition at line 477 of file ffmpeg_dec.c.

Referenced by packet_decode().

◆ send_filter_eof()

static int send_filter_eof ( InputStream ist)
static

Definition at line 528 of file ffmpeg_dec.c.

Referenced by dec_packet().

◆ packet_decode()

static int packet_decode ( InputStream ist,
AVPacket pkt,
AVFrame frame 
)
static

Definition at line 543 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_thread_set_name()

static void dec_thread_set_name ( const InputStream ist)
static

Definition at line 654 of file ffmpeg_dec.c.

Referenced by decoder_thread().

◆ dec_thread_uninit()

static void dec_thread_uninit ( DecThreadContext dt)
static

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

Referenced by decoder_thread().

◆ decoder_thread()

static void* decoder_thread ( void *  arg)
static

Definition at line 689 of file ffmpeg_dec.c.

Referenced by dec_thread_start().

◆ dec_packet()

int dec_packet ( InputStream ist,
const AVPacket pkt,
int  no_eof 
)

Submit a packet for decoding.

When pkt==NULL and no_eof=0, there will be no more input. Flush decoders and mark all downstreams as finished.

When pkt==NULL and no_eof=1, the stream was reset (e.g. after a seek). Flush decoders and await further input.

Definition at line 772 of file ffmpeg_dec.c.

Referenced by decode_flush(), and process_input_packet().

◆ dec_thread_start()

static int dec_thread_start ( InputStream ist)
static

Definition at line 845 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 889 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 925 of file ffmpeg_dec.c.

Referenced by hw_device_setup_for_decode().

◆ hw_device_setup_for_decode()

static int hw_device_setup_for_decode ( InputStream ist)
static

Definition at line 942 of file ffmpeg_dec.c.

Referenced by dec_open().

◆ dec_open()

int dec_open ( InputStream ist)

Definition at line 1070 of file ffmpeg_dec.c.

Referenced by ist_use().