xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Functions
demux_avformat.c File Reference
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include <libavutil/avutil.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/input_plugin.h>
#include <xine/demux.h>
#include "ffmpeg_decoder.h"
#include "ffmpeg_compat.h"

Data Structures

struct  avformat_input_plugin_t
 
struct  avformat_demux_plugin_t
 

Macros

#define LOG_MODULE   "libavformat"
 
#define LOG_VERBOSE
 
#define CODEC_ID(st)   ((st)->codec->codec_id)
 
#define WRAP_THRESHOLD   360000
 

Functions

static off_t input_avformat_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
 
static buf_element_tinput_avformat_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t todo)
 
static off_t input_avformat_get_length (input_plugin_t *this_gen)
 
static uint32_t input_avformat_get_capabilities (input_plugin_t *this_gen)
 
static uint32_t input_avformat_get_blocksize (input_plugin_t *this_gen)
 
static off_t input_avformat_get_current_pos (input_plugin_t *this_gen)
 
static off_t input_avformat_seek (input_plugin_t *this_gen, off_t offset, int origin)
 
static const char * input_avformat_get_mrl (input_plugin_t *this_gen)
 
static int input_avformat_get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
 
static int input_avformat_open (input_plugin_t *this_gen)
 
static void input_avformat_dispose (input_plugin_t *this_gen)
 
static input_plugin_tinput_avformat_get_instance (input_class_t *cls_gen, xine_stream_t *stream, const char *mrl)
 
void * init_avformat_input_plugin (xine_t *xine, const void *data)
 
static void check_newpts (avformat_demux_plugin_t *this, int64_t pts)
 
static uint32_t video_codec_lookup (avformat_demux_plugin_t *this, unsigned id)
 
static uint32_t audio_codec_lookup (avformat_demux_plugin_t *this, unsigned id)
 
static AVProgram * _find_program_from_stream (AVFormatContext *ic, AVProgram *last, int s)
 
static int find_avformat_streams (avformat_demux_plugin_t *this)
 
static void send_headers_audio (avformat_demux_plugin_t *this)
 
static void send_headers_video (avformat_demux_plugin_t *this)
 
static int send_avpacket (avformat_demux_plugin_t *this)
 
static int demux_avformat_get_status (demux_plugin_t *this_gen)
 
static int demux_avformat_get_stream_length (demux_plugin_t *this_gen)
 
static uint32_t demux_avformat_get_capabilities (demux_plugin_t *this_gen)
 
static int demux_avformat_get_optional_data (demux_plugin_t *this_gen, void *data, int data_type)
 
static int demux_avformat_send_chunk (demux_plugin_t *this_gen)
 
static void demux_avformat_send_headers (demux_plugin_t *this_gen)
 
static int avformat_seek (avformat_demux_plugin_t *this, off_t start_pos, int start_time)
 
static int demux_avformat_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing)
 
static void demux_avformat_dispose (demux_plugin_t *this_gen)
 
static int pb_input_read_packet (void *opaque, uint8_t *buf, int buf_size)
 
static int64_t pb_input_seek (void *opaque, int64_t offset, int whence)
 
static AVIOContext * get_io_context (xine_stream_t *stream, input_plugin_t *input)
 
static AVFormatContext * get_format_context (xine_stream_t *stream, input_plugin_t *input)
 
static demux_plugin_topen_demux_avformat_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input)
 
void * init_avformat_demux_plugin (xine_t *xine, const void *data)
 

Macro Definition Documentation

◆ CODEC_ID

#define CODEC_ID ( st)    ((st)->codec->codec_id)

Referenced by find_avformat_streams().

◆ LOG_MODULE

#define LOG_MODULE   "libavformat"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ WRAP_THRESHOLD

#define WRAP_THRESHOLD   360000

Referenced by check_newpts(), and check_newpts().

Function Documentation

◆ _find_program_from_stream()

static AVProgram * _find_program_from_stream ( AVFormatContext * ic,
AVProgram * last,
int s )
static

References NULL.

Referenced by find_avformat_streams().

◆ audio_codec_lookup()

static uint32_t audio_codec_lookup ( avformat_demux_plugin_t * this,
unsigned id )
static

◆ avformat_seek()

static int avformat_seek ( avformat_demux_plugin_t * this,
off_t start_pos,
int start_time )
static

Referenced by demux_avformat_seek().

◆ check_newpts()

static void check_newpts ( avformat_demux_plugin_t * this,
int64_t pts )
static

References _x_demux_control_newpts(), and WRAP_THRESHOLD.

Referenced by send_avpacket().

◆ demux_avformat_dispose()

static void demux_avformat_dispose ( demux_plugin_t * this_gen)
static

References _x_freep().

Referenced by open_demux_avformat_plugin().

◆ demux_avformat_get_capabilities()

static uint32_t demux_avformat_get_capabilities ( demux_plugin_t * this_gen)
static

◆ demux_avformat_get_optional_data()

static int demux_avformat_get_optional_data ( demux_plugin_t * this_gen,
void * data,
int data_type )
static

◆ demux_avformat_get_status()

static int demux_avformat_get_status ( demux_plugin_t * this_gen)
static

◆ demux_avformat_get_stream_length()

static int demux_avformat_get_stream_length ( demux_plugin_t * this_gen)
static

◆ demux_avformat_seek()

static int demux_avformat_seek ( demux_plugin_t * this_gen,
off_t start_pos,
int start_time,
int playing )
static

◆ demux_avformat_send_chunk()

static int demux_avformat_send_chunk ( demux_plugin_t * this_gen)
static

◆ demux_avformat_send_headers()

static void demux_avformat_send_headers ( demux_plugin_t * this_gen)
static

◆ find_avformat_streams()

static int find_avformat_streams ( avformat_demux_plugin_t * this)
static

◆ get_format_context()

static AVFormatContext * get_format_context ( xine_stream_t * stream,
input_plugin_t * input )
static

◆ get_io_context()

static AVIOContext * get_io_context ( xine_stream_t * stream,
input_plugin_t * input )
static

◆ init_avformat_demux_plugin()

void * init_avformat_demux_plugin ( xine_t * xine,
const void * data )

◆ init_avformat_input_plugin()

void * init_avformat_input_plugin ( xine_t * xine,
const void * data )

◆ input_avformat_dispose()

static void input_avformat_dispose ( input_plugin_t * this_gen)
static

References _x_freep().

Referenced by input_avformat_get_instance().

◆ input_avformat_get_blocksize()

static uint32_t input_avformat_get_blocksize ( input_plugin_t * this_gen)
static

◆ input_avformat_get_capabilities()

static uint32_t input_avformat_get_capabilities ( input_plugin_t * this_gen)
static

◆ input_avformat_get_current_pos()

static off_t input_avformat_get_current_pos ( input_plugin_t * this_gen)
static

◆ input_avformat_get_instance()

static input_plugin_t * input_avformat_get_instance ( input_class_t * cls_gen,
xine_stream_t * stream,
const char * mrl )
static

◆ input_avformat_get_length()

static off_t input_avformat_get_length ( input_plugin_t * this_gen)
static

◆ input_avformat_get_mrl()

static const char * input_avformat_get_mrl ( input_plugin_t * this_gen)
static

◆ input_avformat_get_optional_data()

static int input_avformat_get_optional_data ( input_plugin_t * this_gen,
void * data,
int data_type )
static

◆ input_avformat_open()

static int input_avformat_open ( input_plugin_t * this_gen)
static

◆ input_avformat_read()

static off_t input_avformat_read ( input_plugin_t * this_gen,
void * buf_gen,
off_t len )
static

◆ input_avformat_read_block()

static buf_element_t * input_avformat_read_block ( input_plugin_t * this_gen,
fifo_buffer_t * fifo,
off_t todo )
static

References NULL.

Referenced by input_avformat_get_instance().

◆ input_avformat_seek()

static off_t input_avformat_seek ( input_plugin_t * this_gen,
off_t offset,
int origin )
static

◆ open_demux_avformat_plugin()

static demux_plugin_t * open_demux_avformat_plugin ( demux_class_t * class_gen,
xine_stream_t * stream,
input_plugin_t * input )
static

◆ pb_input_read_packet()

static int pb_input_read_packet ( void * opaque,
uint8_t * buf,
int buf_size )
static

References input(), and input_plugin_s::read.

Referenced by get_io_context().

◆ pb_input_seek()

static int64_t pb_input_seek ( void * opaque,
int64_t offset,
int whence )
static

References input_plugin_s::get_length, and input().

Referenced by get_io_context().

◆ send_avpacket()

static int send_avpacket ( avformat_demux_plugin_t * this)
static

◆ send_headers_audio()

static void send_headers_audio ( avformat_demux_plugin_t * this)
static

◆ send_headers_video()

static void send_headers_video ( avformat_demux_plugin_t * this)
static

◆ video_codec_lookup()

static uint32_t video_codec_lookup ( avformat_demux_plugin_t * this,
unsigned id )
static