MythTV  master
Classes | Macros | Typedefs | Functions
pes.h File Reference
#include <stdint.h>
#include "ringbuffer.h"
Include dependency graph for pes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ps_packet_
 
struct  pes_in_s
 

Macros

#define TS_HEADER_MIN   4
 
#define PS_HEADER_L1   14
 
#define PS_HEADER_L2   (PS_HEADER_L1+24)
 
#define PES_MIN   7
 
#define PES_H_MIN   9
 
#define SYSTEM_START_CODE_S   0xB9
 
#define SYSTEM_START_CODE_E   0xFF
 
#define PACK_START   0xBA
 
#define SYS_START   0xBB
 
#define PROG_STREAM_MAP   0xBC
 
#define PRIVATE_STREAM1   0xBD
 
#define PADDING_STREAM   0xBE
 
#define PRIVATE_STREAM2   0xBF
 
#define AUDIO_STREAM_S   0xC0
 
#define AUDIO_STREAM_E   0xDF
 
#define VIDEO_STREAM_S   0xE0
 
#define VIDEO_STREAM_E   0xEF
 
#define ECM_STREAM   0xF0
 
#define EMM_STREAM   0xF1
 
#define DSM_CC_STREAM   0xF2
 
#define ISO13522_STREAM   0xF3
 
#define PROG_STREAM_DIR   0xFF
 
#define PTS_DTS_FLAGS   0xC0
 
#define ESCR_FLAG   0x20
 
#define ES_RATE_FLAG   0x10
 
#define DSM_TRICK_FLAG   0x08
 
#define ADD_CPY_FLAG   0x04
 
#define PES_CRC_FLAG   0x02
 
#define PES_EXT_FLAG   0x01
 
#define PTS_ONLY   0x80
 
#define PTS_DTS   0xC0
 
#define MAX_PLENGTH   0xFFFF
 
#define MMAX_PLENGTH   (8*MAX_PLENGTH)
 
#define MAX_PTS   (0x0000000200000000ULL)
 
#define MAX_PTS2   (300* MAX_PTS)
 

Typedefs

typedef struct ps_packet_ ps_packet
 
typedef struct pes_in_s pes_in_t
 

Functions

void init_pes_in (pes_in_t *p, int type, ringbuffer *rb, int wi)
 
void get_pes (pes_in_t *p, uint8_t *buf, int count, void(*func)(pes_in_t *p))
 
void printpts (int64_t pts)
 
void printptss (int64_t pts)
 
int64_t ptsdiff (uint64_t pts1, uint64_t pts2)
 
uint64_t uptsdiff (uint64_t pts1, uint64_t pts2)
 
int ptscmp (uint64_t pts1, uint64_t pts2)
 
uint64_t ptsadd (uint64_t pts1, uint64_t pts2)
 
int write_pes_header (uint8_t id, int length, uint64_t PTS, uint64_t DTS, uint8_t *obuf, int stuffing, uint8_t ptsdts)
 
void write_padding_pes (int pack_size, int extcnt, uint64_t SCR, uint64_t muxr, uint8_t *buf)
 
int write_ac3_pes (int pack_size, int extcnt, int n, uint64_t pts, uint64_t SCR, uint32_t muxr, uint8_t *buf, int *alength, uint8_t ptsdts, int nframes, int ac3_off, ringbuffer *ac3rbuffer)
 
int write_audio_pes (int pack_size, int extcnt, int n, uint64_t pts, uint64_t SCR, uint32_t muxr, uint8_t *buf, int *alength, uint8_t ptsdts, ringbuffer *arbuffer)
 
int write_video_pes (int pack_size, int extcnt, uint64_t vpts, uint64_t vdts, uint64_t SCR, uint64_t muxr, uint8_t *buf, int *vlength, uint8_t ptsdts, ringbuffer *vrbuffer)
 
int write_nav_pack (int pack_size, int extcnt, uint64_t SCR, uint32_t muxr, uint8_t *buf)
 
static void ptsdec (uint64_t *pts1, uint64_t pts2)
 
static void ptsinc (uint64_t *pts1, uint64_t pts2)
 

Macro Definition Documentation

◆ TS_HEADER_MIN

#define TS_HEADER_MIN   4

Definition at line 12 of file pes.h.

◆ PS_HEADER_L1

#define PS_HEADER_L1   14

Definition at line 13 of file pes.h.

◆ PS_HEADER_L2

#define PS_HEADER_L2   (PS_HEADER_L1+24)

Definition at line 14 of file pes.h.

◆ PES_MIN

#define PES_MIN   7

Definition at line 15 of file pes.h.

◆ PES_H_MIN

#define PES_H_MIN   9

Definition at line 16 of file pes.h.

◆ SYSTEM_START_CODE_S

#define SYSTEM_START_CODE_S   0xB9

Definition at line 18 of file pes.h.

◆ SYSTEM_START_CODE_E

#define SYSTEM_START_CODE_E   0xFF

Definition at line 19 of file pes.h.

◆ PACK_START

#define PACK_START   0xBA

Definition at line 20 of file pes.h.

◆ SYS_START

#define SYS_START   0xBB

Definition at line 21 of file pes.h.

◆ PROG_STREAM_MAP

#define PROG_STREAM_MAP   0xBC

Definition at line 22 of file pes.h.

◆ PRIVATE_STREAM1

#define PRIVATE_STREAM1   0xBD

Definition at line 23 of file pes.h.

◆ PADDING_STREAM

#define PADDING_STREAM   0xBE

Definition at line 24 of file pes.h.

◆ PRIVATE_STREAM2

#define PRIVATE_STREAM2   0xBF

Definition at line 25 of file pes.h.

◆ AUDIO_STREAM_S

#define AUDIO_STREAM_S   0xC0

Definition at line 26 of file pes.h.

◆ AUDIO_STREAM_E

#define AUDIO_STREAM_E   0xDF

Definition at line 27 of file pes.h.

◆ VIDEO_STREAM_S

#define VIDEO_STREAM_S   0xE0

Definition at line 28 of file pes.h.

◆ VIDEO_STREAM_E

#define VIDEO_STREAM_E   0xEF

Definition at line 29 of file pes.h.

◆ ECM_STREAM

#define ECM_STREAM   0xF0

Definition at line 30 of file pes.h.

◆ EMM_STREAM

#define EMM_STREAM   0xF1

Definition at line 31 of file pes.h.

◆ DSM_CC_STREAM

#define DSM_CC_STREAM   0xF2

Definition at line 32 of file pes.h.

◆ ISO13522_STREAM

#define ISO13522_STREAM   0xF3

Definition at line 33 of file pes.h.

◆ PROG_STREAM_DIR

#define PROG_STREAM_DIR   0xFF

Definition at line 34 of file pes.h.

◆ PTS_DTS_FLAGS

#define PTS_DTS_FLAGS   0xC0

Definition at line 37 of file pes.h.

◆ ESCR_FLAG

#define ESCR_FLAG   0x20

Definition at line 38 of file pes.h.

◆ ES_RATE_FLAG

#define ES_RATE_FLAG   0x10

Definition at line 39 of file pes.h.

◆ DSM_TRICK_FLAG

#define DSM_TRICK_FLAG   0x08

Definition at line 40 of file pes.h.

◆ ADD_CPY_FLAG

#define ADD_CPY_FLAG   0x04

Definition at line 41 of file pes.h.

◆ PES_CRC_FLAG

#define PES_CRC_FLAG   0x02

Definition at line 42 of file pes.h.

◆ PES_EXT_FLAG

#define PES_EXT_FLAG   0x01

Definition at line 43 of file pes.h.

◆ PTS_ONLY

#define PTS_ONLY   0x80

Definition at line 46 of file pes.h.

◆ PTS_DTS

#define PTS_DTS   0xC0

Definition at line 47 of file pes.h.

◆ MAX_PLENGTH

#define MAX_PLENGTH   0xFFFF

Definition at line 49 of file pes.h.

◆ MMAX_PLENGTH

#define MMAX_PLENGTH   (8*MAX_PLENGTH)

Definition at line 50 of file pes.h.

◆ MAX_PTS

#define MAX_PTS   (0x0000000200000000ULL)

Definition at line 52 of file pes.h.

◆ MAX_PTS2

#define MAX_PTS2   (300* MAX_PTS)

Definition at line 53 of file pes.h.

Typedef Documentation

◆ ps_packet

typedef struct ps_packet_ ps_packet

◆ pes_in_t

typedef struct pes_in_s pes_in_t

Function Documentation

◆ init_pes_in()

void init_pes_in ( pes_in_t p,
int  type,
ringbuffer rb,
int  wi 
)

◆ get_pes()

void get_pes ( pes_in_t p,
uint8_t *  buf,
int  count,
void(*)(pes_in_t *p)  func 
)

Definition at line 165 of file pes.c.

Referenced by find_pes_ids(), replex_fill_buffers(), and replex_tsp().

◆ printpts()

void printpts ( int64_t  pts)

◆ printptss()

void printptss ( int64_t  pts)

Definition at line 59 of file pes.c.

Referenced by do_analyze().

◆ ptsdiff()

int64_t ptsdiff ( uint64_t  pts1,
uint64_t  pts2 
)

◆ uptsdiff()

uint64_t uptsdiff ( uint64_t  pts1,
uint64_t  pts2 
)

◆ ptscmp()

int ptscmp ( uint64_t  pts1,
uint64_t  pts2 
)

Definition at line 116 of file pes.c.

Referenced by check_times(), dummy_delete(), fix_audio(), ptsdiff(), use_video(), and which_ext().

◆ ptsadd()

uint64_t ptsadd ( uint64_t  pts1,
uint64_t  pts2 
)

Definition at line 140 of file pes.c.

◆ write_pes_header()

int write_pes_header ( uint8_t  id,
int  length,
uint64_t  PTS,
uint64_t  DTS,
uint8_t *  obuf,
int  stuffing,
uint8_t  ptsdts 
)

◆ write_padding_pes()

void write_padding_pes ( int  pack_size,
int  extcnt,
uint64_t  SCR,
uint64_t  muxr,
uint8_t *  buf 
)

Definition at line 687 of file pes.c.

Referenced by writeout_padding().

◆ write_ac3_pes()

int write_ac3_pes ( int  pack_size,
int  extcnt,
int  n,
uint64_t  pts,
uint64_t  SCR,
uint32_t  muxr,
uint8_t *  buf,
int *  alength,
uint8_t  ptsdts,
int  nframes,
int  ac3_off,
ringbuffer ac3rbuffer 
)

Definition at line 801 of file pes.c.

Referenced by writeout_ext().

◆ write_audio_pes()

int write_audio_pes ( int  pack_size,
int  extcnt,
int  n,
uint64_t  pts,
uint64_t  SCR,
uint32_t  muxr,
uint8_t *  buf,
int *  alength,
uint8_t  ptsdts,
ringbuffer arbuffer 
)

Definition at line 753 of file pes.c.

Referenced by writeout_ext().

◆ write_video_pes()

int write_video_pes ( int  pack_size,
int  extcnt,
uint64_t  vpts,
uint64_t  vdts,
uint64_t  SCR,
uint64_t  muxr,
uint8_t *  buf,
int *  vlength,
uint8_t  ptsdts,
ringbuffer vrbuffer 
)

Definition at line 700 of file pes.c.

Referenced by writeout_video().

◆ write_nav_pack()

int write_nav_pack ( int  pack_size,
int  extcnt,
uint64_t  SCR,
uint32_t  muxr,
uint8_t *  buf 
)

Definition at line 857 of file pes.c.

Referenced by setup_multiplex(), and writeout_video().

◆ ptsdec()

static void ptsdec ( uint64_t *  pts1,
uint64_t  pts2 
)
inlinestatic

Definition at line 124 of file pes.h.

Referenced by analyze_video(), and PTSOffsetQueue::UpdateOrigPTS().

◆ ptsinc()

static void ptsinc ( uint64_t *  pts1,
uint64_t  pts2 
)
inlinestatic