FFmpeg
Data Structures | Functions | Variables
ffmpeg_demux.c File Reference
#include <float.h>
#include <stdint.h>
#include "ffmpeg.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/display.h"
#include "libavutil/error.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libavcodec/packet.h"
#include "libavformat/avformat.h"

Go to the source code of this file.

Data Structures

struct  Demuxer
 
struct  DemuxMsg
 

Functions

static Demuxerdemuxer_from_ifile (InputFile *f)
 
static void report_new_stream (Demuxer *d, const AVPacket *pkt)
 
static void ifile_duration_update (Demuxer *d, InputStream *ist, int64_t last_duration)
 
static int seek_to_start (Demuxer *d)
 
static void ts_fixup (Demuxer *d, AVPacket *pkt, int *repeat_pict)
 
static void thread_set_name (InputFile *f)
 
static void * input_thread (void *arg)
 
static void thread_stop (Demuxer *d)
 
static int thread_start (Demuxer *d)
 
int ifile_get_packet (InputFile *f, AVPacket **pkt)
 Get next input packet from the demuxer. More...
 
static void ist_free (InputStream **pist)
 
void ifile_close (InputFile **pf)
 
static const AVCodecchoose_decoder (const OptionsContext *o, AVFormatContext *s, AVStream *st, enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type)
 
static int guess_input_channel_layout (InputStream *ist)
 
static void add_display_matrix_to_stream (const OptionsContext *o, AVFormatContext *ctx, AVStream *st)
 
static void add_input_streams (const OptionsContext *o, Demuxer *d)
 
static void dump_attachment (AVStream *st, const char *filename)
 
int ifile_open (const OptionsContext *o, const char *filename)
 

Variables

static const char *const opt_name_discard [] = {"discard", NULL}
 
static const char *const opt_name_reinit_filters [] = {"reinit_filter", NULL}
 
static const char *const opt_name_fix_sub_duration [] = {"fix_sub_duration", NULL}
 
static const char *const opt_name_canvas_sizes [] = {"canvas_size", NULL}
 
static const char *const opt_name_guess_layout_max [] = {"guess_layout_max", NULL}
 
static const char *const opt_name_ts_scale [] = {"itsscale", NULL}
 
static const char *const opt_name_hwaccels [] = {"hwaccel", NULL}
 
static const char *const opt_name_hwaccel_devices [] = {"hwaccel_device", NULL}
 
static const char *const opt_name_hwaccel_output_formats [] = {"hwaccel_output_format", NULL}
 
static const char *const opt_name_autorotate [] = {"autorotate", NULL}
 
static const char *const opt_name_display_rotations [] = {"display_rotation", NULL}
 
static const char *const opt_name_display_hflips [] = {"display_hflip", NULL}
 
static const char *const opt_name_display_vflips [] = {"display_vflip", NULL}
 

Function Documentation

◆ demuxer_from_ifile()

static Demuxer* demuxer_from_ifile ( InputFile f)
static

Definition at line 83 of file ffmpeg_demux.c.

Referenced by ifile_close(), and ifile_get_packet().

◆ report_new_stream()

static void report_new_stream ( Demuxer d,
const AVPacket pkt 
)
static

Definition at line 88 of file ffmpeg_demux.c.

Referenced by input_thread().

◆ ifile_duration_update()

static void ifile_duration_update ( Demuxer d,
InputStream ist,
int64_t  last_duration 
)
static

Definition at line 102 of file ffmpeg_demux.c.

Referenced by seek_to_start().

◆ seek_to_start()

static int seek_to_start ( Demuxer d)
static

Definition at line 119 of file ffmpeg_demux.c.

Referenced by input_thread().

◆ ts_fixup()

static void ts_fixup ( Demuxer d,
AVPacket pkt,
int repeat_pict 
)
static

Definition at line 169 of file ffmpeg_demux.c.

Referenced by input_thread().

◆ thread_set_name()

static void thread_set_name ( InputFile f)
static

Definition at line 230 of file ffmpeg_demux.c.

Referenced by input_thread().

◆ input_thread()

static void* input_thread ( void *  arg)
static

Definition at line 237 of file ffmpeg_demux.c.

Referenced by thread_start().

◆ thread_stop()

static void thread_stop ( Demuxer d)
static

Definition at line 347 of file ffmpeg_demux.c.

Referenced by ifile_close().

◆ thread_start()

static int thread_start ( Demuxer d)
static

Definition at line 363 of file ffmpeg_demux.c.

Referenced by ifile_get_packet().

◆ ifile_get_packet()

int ifile_get_packet ( InputFile f,
AVPacket **  pkt 
)

Get next input packet from the demuxer.

Parameters
pktthe packet is written here when this function returns 0
Returns
  • 0 when a packet has been read successfully
  • 1 when stream end was reached, but the stream is looped; caller should flush decoders and read from this demuxer again
  • a negative error code on failure

Definition at line 410 of file ffmpeg_demux.c.

Referenced by process_input().

◆ ist_free()

static void ist_free ( InputStream **  pist)
static

Definition at line 457 of file ffmpeg_demux.c.

Referenced by ifile_close().

◆ ifile_close()

void ifile_close ( InputFile **  pf)

Definition at line 479 of file ffmpeg_demux.c.

Referenced by ffmpeg_cleanup().

◆ choose_decoder()

static const AVCodec* choose_decoder ( const OptionsContext o,
AVFormatContext s,
AVStream st,
enum HWAccelID  hwaccel_id,
enum AVHWDeviceType  hwaccel_device_type 
)
static

Definition at line 498 of file ffmpeg_demux.c.

Referenced by add_input_streams(), and ifile_open().

◆ guess_input_channel_layout()

static int guess_input_channel_layout ( InputStream ist)
static

Definition at line 539 of file ffmpeg_demux.c.

Referenced by add_input_streams().

◆ add_display_matrix_to_stream()

static void add_display_matrix_to_stream ( const OptionsContext o,
AVFormatContext ctx,
AVStream st 
)
static

Definition at line 558 of file ffmpeg_demux.c.

Referenced by add_input_streams().

◆ add_input_streams()

static void add_input_streams ( const OptionsContext o,
Demuxer d 
)
static

Definition at line 592 of file ffmpeg_demux.c.

Referenced by ifile_open().

◆ dump_attachment()

static void dump_attachment ( AVStream st,
const char *  filename 
)
static

Definition at line 810 of file ffmpeg_demux.c.

Referenced by ifile_open().

◆ ifile_open()

int ifile_open ( const OptionsContext o,
const char *  filename 
)

Definition at line 842 of file ffmpeg_demux.c.

Variable Documentation

◆ opt_name_discard

const char* const opt_name_discard[] = {"discard", NULL}
static

Definition at line 41 of file ffmpeg_demux.c.

◆ opt_name_reinit_filters

const char* const opt_name_reinit_filters[] = {"reinit_filter", NULL}
static

Definition at line 42 of file ffmpeg_demux.c.

◆ opt_name_fix_sub_duration

const char* const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL}
static

Definition at line 43 of file ffmpeg_demux.c.

◆ opt_name_canvas_sizes

const char* const opt_name_canvas_sizes[] = {"canvas_size", NULL}
static

Definition at line 44 of file ffmpeg_demux.c.

◆ opt_name_guess_layout_max

const char* const opt_name_guess_layout_max[] = {"guess_layout_max", NULL}
static

Definition at line 45 of file ffmpeg_demux.c.

◆ opt_name_ts_scale

const char* const opt_name_ts_scale[] = {"itsscale", NULL}
static

Definition at line 46 of file ffmpeg_demux.c.

◆ opt_name_hwaccels

const char* const opt_name_hwaccels[] = {"hwaccel", NULL}
static

Definition at line 47 of file ffmpeg_demux.c.

◆ opt_name_hwaccel_devices

const char* const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL}
static

Definition at line 48 of file ffmpeg_demux.c.

◆ opt_name_hwaccel_output_formats

const char* const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL}
static

Definition at line 49 of file ffmpeg_demux.c.

◆ opt_name_autorotate

const char* const opt_name_autorotate[] = {"autorotate", NULL}
static

Definition at line 50 of file ffmpeg_demux.c.

◆ opt_name_display_rotations

const char* const opt_name_display_rotations[] = {"display_rotation", NULL}
static

Definition at line 51 of file ffmpeg_demux.c.

◆ opt_name_display_hflips

const char* const opt_name_display_hflips[] = {"display_hflip", NULL}
static

Definition at line 52 of file ffmpeg_demux.c.

◆ opt_name_display_vflips

const char* const opt_name_display_vflips[] = {"display_vflip", NULL}
static

Definition at line 53 of file ffmpeg_demux.c.