FFmpeg
Data Structures | Macros | Functions | Variables
mpeg.c File Reference
#include "config_components.h"
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
#include "mpeg.h"

Go to the source code of this file.

Data Structures

struct  MpegDemuxContext
 

Macros

#define MAX_SYNC_SIZE   100000
 

Functions

static int check_pes (const uint8_t *p, const uint8_t *end)
 
static int check_pack_header (const uint8_t *buf)
 
static int mpegps_probe (const AVProbeData *p)
 
static int mpegps_read_header (AVFormatContext *s)
 
static int64_t get_pts (AVIOContext *pb, int c)
 
static int find_next_start_code (AVIOContext *pb, int *size_ptr, int32_t *header_state)
 
static long mpegps_psm_parse (MpegDemuxContext *m, AVIOContext *pb)
 Extract stream types from a program stream map According to ISO/IEC 13818-1 ('MPEG-2 Systems') table 2-35. More...
 
static int mpegps_read_pes_header (AVFormatContext *s, int64_t *ppos, int *pstart_code, int64_t *ppts, int64_t *pdts)
 
static int mpegps_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int64_t mpegps_read_dts (AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
 

Variables

const FFInputFormat ff_mpegps_demuxer
 

Macro Definition Documentation

◆ MAX_SYNC_SIZE

#define MAX_SYNC_SIZE   100000

Definition at line 34 of file mpeg.c.

Function Documentation

◆ check_pes()

static int check_pes ( const uint8_t *  p,
const uint8_t *  end 
)
static

Definition at line 36 of file mpeg.c.

Referenced by mpegps_probe().

◆ check_pack_header()

static int check_pack_header ( const uint8_t *  buf)
static

Definition at line 58 of file mpeg.c.

Referenced by mpegps_probe().

◆ mpegps_probe()

static int mpegps_probe ( const AVProbeData p)
static

Definition at line 63 of file mpeg.c.

◆ mpegps_read_header()

static int mpegps_read_header ( AVFormatContext s)
static

Definition at line 133 of file mpeg.c.

◆ get_pts()

static int64_t get_pts ( AVIOContext pb,
int  c 
)
static

Definition at line 154 of file mpeg.c.

Referenced by mpegps_read_pes_header().

◆ find_next_start_code()

static int find_next_start_code ( AVIOContext pb,
int size_ptr,
int32_t header_state 
)
static

Definition at line 167 of file mpeg.c.

Referenced by mpegps_read_pes_header().

◆ mpegps_psm_parse()

static long mpegps_psm_parse ( MpegDemuxContext m,
AVIOContext pb 
)
static

Extract stream types from a program stream map According to ISO/IEC 13818-1 ('MPEG-2 Systems') table 2-35.

Returns
number of bytes occupied by PSM in the bitstream

Definition at line 201 of file mpeg.c.

Referenced by mpegps_read_pes_header().

◆ mpegps_read_pes_header()

static int mpegps_read_pes_header ( AVFormatContext s,
int64_t ppos,
int pstart_code,
int64_t ppts,
int64_t pdts 
)
static

Definition at line 235 of file mpeg.c.

Referenced by mpegps_read_dts(), and mpegps_read_packet().

◆ mpegps_read_packet()

static int mpegps_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 482 of file mpeg.c.

◆ mpegps_read_dts()

static int64_t mpegps_read_dts ( AVFormatContext s,
int  stream_index,
int64_t ppos,
int64_t  pos_limit 
)
static

Definition at line 668 of file mpeg.c.

Variable Documentation

◆ ff_mpegps_demuxer

const FFInputFormat ff_mpegps_demuxer
Initial value:
= {
.p.name = "mpeg",
.p.long_name = NULL_IF_CONFIG_SMALL("MPEG-PS (MPEG-2 Program Stream)"),
.priv_data_size = sizeof(MpegDemuxContext),
}

Definition at line 698 of file mpeg.c.

Referenced by dvdvideo_subdemux_open().

mpegps_read_packet
static int mpegps_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: mpeg.c:482
AVFMT_SHOW_IDS
#define AVFMT_SHOW_IDS
Show format stream IDs numbers.
Definition: avformat.h:477
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
mpegps_read_header
static int mpegps_read_header(AVFormatContext *s)
Definition: mpeg.c:133
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:550
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AVFMT_TS_DISCONT
#define AVFMT_TS_DISCONT
Format allows timestamp discontinuities.
Definition: avformat.h:481
mpegps_probe
static int mpegps_probe(const AVProbeData *p)
Definition: mpeg.c:63
mpegps_read_dts
static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
Definition: mpeg.c:668
read_timestamp
static int64_t read_timestamp(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit, int64_t(*read_timestamp)(struct AVFormatContext *, int, int64_t *, int64_t))
Definition: seek.c:279
MpegDemuxContext
Definition: mpeg.c:124