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

Go to the source code of this file.

Classes

struct  sequence_s
 
struct  audio_frame_s
 

Macros

#define PICTURE_START_CODE   0x00
 
#define SLICE_START_CODE_S   0x01
 
#define SLICE_START_CODE_E   0xAF
 
#define EXCEPT_SLICE   0xb0
 
#define USR_DATA_START_CODE   0xB2
 
#define SEQUENCE_HDR_CODE   0xB3
 
#define SEQUENCE_ERR_CODE   0xB4
 
#define EXTENSION_START_CODE   0xB5
 
#define SEQUENCE_END_CODE   0xB7
 
#define GROUP_START_CODE   0xB8
 
#define SEQUENCE_EXTENSION   0x01
 
#define SEQUENCE_DISPLAY_EXTENSION   0x02
 
#define PICTURE_CODING_EXTENSION   0x08
 
#define QUANT_MATRIX_EXTENSION   0x03
 
#define PICTURE_DISPLAY_EXTENSION   0x07
 
#define I_FRAME   0x01
 
#define P_FRAME   0x02
 
#define B_FRAME   0x03
 
#define D_FRAME   0x04
 
#define OFF_SIZE   4
 
#define FIRST_FIELD   0
 
#define SECOND_FIELD   1
 
#define VIDEO_FRAME_PICTURE   0x03
 
#define MPG_TIMESTEP   90000ULL
 
#define CSPF_FLAG   0x04
 
#define INTRAQ_FLAG   0x02
 
#define NONINTRAQ_FLAG   0x01
 
#define AUDIO_SYNCWORD   0x7ff /* or is it 0xfff */
 
#define AC3_SYNCWORD   0x0b77
 
#define NOPULLDOWN   0
 
#define PULLDOWN32   1
 
#define PULLDOWN23   2
 
#define CLOCK_MS   27000ULL
 
#define CLOCK_PER   27000000000ULL
 
#define SEC_PER   (CLOCK_PER/s->frame_rate)
 

Typedefs

typedef struct sequence_s sequence_t
 
typedef struct audio_frame_s audio_frame_t
 

Enumerations

enum  { VIDEO_NONE =0, VIDEO_PAL, VIDEO_NTSC }
 
enum  {
  NONE =0, AC3, MPEG_AUDIO, LPCM,
  MAX_TYPES
}
 

Functions

void pts2time (uint64_t pts, uint8_t *buf, int len)
 
int find_audio_sync (ringbuffer *rbuf, uint8_t *buf, int off, int type, int le)
 
int find_audio_s (const uint8_t *rbuf, int off, int type, int le)
 
int get_video_info (ringbuffer *rbuf, sequence_t *s, int off, int le)
 
int get_audio_info (ringbuffer *rbuf, audio_frame_t *af, int off, int le)
 
int get_ac3_info (ringbuffer *rbuf, audio_frame_t *af, int off, int le)
 
uint64_t add_pts_audio (uint64_t pts, audio_frame_t *aframe, uint64_t frames)
 
uint64_t next_ptsdts_video (uint64_t *pts, sequence_t *s, uint64_t fcount, uint64_t gcount)
 
void fix_audio_count (uint64_t *acount, audio_frame_t *aframe, uint64_t origpts, uint64_t pts)
 
void fix_video_count (sequence_t *s, uint64_t *frame, uint64_t origpts, uint64_t pts, uint64_t origdts, uint64_t dts)
 
int check_audio_header (ringbuffer *rbuf, audio_frame_t *af, int off, int le, int type)
 
int get_video_ext_info (ringbuffer *rbuf, sequence_t *s, int off, int le)
 

Macro Definition Documentation

◆ PICTURE_START_CODE

#define PICTURE_START_CODE   0x00

Definition at line 34 of file element.h.

◆ SLICE_START_CODE_S

#define SLICE_START_CODE_S   0x01

Definition at line 35 of file element.h.

◆ SLICE_START_CODE_E

#define SLICE_START_CODE_E   0xAF

Definition at line 37 of file element.h.

◆ EXCEPT_SLICE

#define EXCEPT_SLICE   0xb0

Definition at line 38 of file element.h.

◆ USR_DATA_START_CODE

#define USR_DATA_START_CODE   0xB2

Definition at line 40 of file element.h.

◆ SEQUENCE_HDR_CODE

#define SEQUENCE_HDR_CODE   0xB3

Definition at line 41 of file element.h.

◆ SEQUENCE_ERR_CODE

#define SEQUENCE_ERR_CODE   0xB4

Definition at line 42 of file element.h.

◆ EXTENSION_START_CODE

#define EXTENSION_START_CODE   0xB5

Definition at line 43 of file element.h.

◆ SEQUENCE_END_CODE

#define SEQUENCE_END_CODE   0xB7

Definition at line 44 of file element.h.

◆ GROUP_START_CODE

#define GROUP_START_CODE   0xB8

Definition at line 45 of file element.h.

◆ SEQUENCE_EXTENSION

#define SEQUENCE_EXTENSION   0x01

Definition at line 47 of file element.h.

◆ SEQUENCE_DISPLAY_EXTENSION

#define SEQUENCE_DISPLAY_EXTENSION   0x02

Definition at line 48 of file element.h.

◆ PICTURE_CODING_EXTENSION

#define PICTURE_CODING_EXTENSION   0x08

Definition at line 49 of file element.h.

◆ QUANT_MATRIX_EXTENSION

#define QUANT_MATRIX_EXTENSION   0x03

Definition at line 50 of file element.h.

◆ PICTURE_DISPLAY_EXTENSION

#define PICTURE_DISPLAY_EXTENSION   0x07

Definition at line 51 of file element.h.

◆ I_FRAME

#define I_FRAME   0x01

Definition at line 53 of file element.h.

◆ P_FRAME

#define P_FRAME   0x02

Definition at line 54 of file element.h.

◆ B_FRAME

#define B_FRAME   0x03

Definition at line 55 of file element.h.

◆ D_FRAME

#define D_FRAME   0x04

Definition at line 56 of file element.h.

◆ OFF_SIZE

#define OFF_SIZE   4

Definition at line 58 of file element.h.

◆ FIRST_FIELD

#define FIRST_FIELD   0

Definition at line 59 of file element.h.

◆ SECOND_FIELD

#define SECOND_FIELD   1

Definition at line 60 of file element.h.

◆ VIDEO_FRAME_PICTURE

#define VIDEO_FRAME_PICTURE   0x03

Definition at line 61 of file element.h.

◆ MPG_TIMESTEP

#define MPG_TIMESTEP   90000ULL

Definition at line 63 of file element.h.

◆ CSPF_FLAG

#define CSPF_FLAG   0x04

Definition at line 66 of file element.h.

◆ INTRAQ_FLAG

#define INTRAQ_FLAG   0x02

Definition at line 67 of file element.h.

◆ NONINTRAQ_FLAG

#define NONINTRAQ_FLAG   0x01

Definition at line 68 of file element.h.

◆ AUDIO_SYNCWORD

#define AUDIO_SYNCWORD   0x7ff /* or is it 0xfff */

Definition at line 70 of file element.h.

◆ AC3_SYNCWORD

#define AC3_SYNCWORD   0x0b77

Definition at line 71 of file element.h.

◆ NOPULLDOWN

#define NOPULLDOWN   0

Definition at line 73 of file element.h.

◆ PULLDOWN32

#define PULLDOWN32   1

Definition at line 74 of file element.h.

◆ PULLDOWN23

#define PULLDOWN23   2

Definition at line 75 of file element.h.

◆ CLOCK_MS

#define CLOCK_MS   27000ULL

Definition at line 77 of file element.h.

◆ CLOCK_PER

#define CLOCK_PER   27000000000ULL

Definition at line 78 of file element.h.

◆ SEC_PER

#define SEC_PER   (CLOCK_PER/s->frame_rate)

Definition at line 79 of file element.h.

Typedef Documentation

◆ sequence_t

typedef struct sequence_s sequence_t

◆ audio_frame_t

typedef struct audio_frame_s audio_frame_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VIDEO_NONE 
VIDEO_PAL 
VIDEO_NTSC 

Definition at line 64 of file element.h.

◆ anonymous enum

anonymous enum
Enumerator
NONE 
AC3 
MPEG_AUDIO 
LPCM 
MAX_TYPES 

Definition at line 82 of file element.h.

Function Documentation

◆ pts2time()

void pts2time ( uint64_t  pts,
uint8_t *  buf,
int  len 
)

Definition at line 150 of file element.c.

Referenced by writeout_video().

◆ find_audio_sync()

int find_audio_sync ( ringbuffer rbuf,
uint8_t *  buf,
int  off,
int  type,
int  le 
)

Definition at line 322 of file element.c.

Referenced by analyze_audio(), check_audio_header(), get_ac3_info(), and get_audio_info().

◆ find_audio_s()

int find_audio_s ( const uint8_t *  rbuf,
int  off,
int  type,
int  le 
)

Definition at line 373 of file element.c.

Referenced by pes_id_out().

◆ get_video_info()

int get_video_info ( ringbuffer rbuf,
sequence_t s,
int  off,
int  le 
)

Definition at line 191 of file element.c.

Referenced by analyze_video().

◆ get_audio_info()

int get_audio_info ( ringbuffer rbuf,
audio_frame_t af,
int  off,
int  le 
)

Definition at line 482 of file element.c.

Referenced by analyze_audio().

◆ get_ac3_info()

int get_ac3_info ( ringbuffer rbuf,
audio_frame_t af,
int  off,
int  le 
)

Definition at line 533 of file element.c.

Referenced by analyze_audio().

◆ add_pts_audio()

uint64_t add_pts_audio ( uint64_t  pts,
audio_frame_t aframe,
uint64_t  frames 
)

Definition at line 56 of file element.c.

Referenced by analyze_audio().

◆ next_ptsdts_video()

uint64_t next_ptsdts_video ( uint64_t *  pts,
sequence_t s,
uint64_t  fcount,
uint64_t  gcount 
)

Definition at line 75 of file element.c.

Referenced by analyze_video().

◆ fix_audio_count()

void fix_audio_count ( uint64_t *  acount,
audio_frame_t aframe,
uint64_t  origpts,
uint64_t  pts 
)

Definition at line 65 of file element.c.

Referenced by analyze_audio().

◆ fix_video_count()

void fix_video_count ( sequence_t s,
uint64_t *  frame,
uint64_t  origpts,
uint64_t  pts,
uint64_t  origdts,
uint64_t  dts 
)

Definition at line 115 of file element.c.

Referenced by analyze_video().

◆ check_audio_header()

int check_audio_header ( ringbuffer rbuf,
audio_frame_t af,
int  off,
int  le,
int  type 
)

Definition at line 418 of file element.c.

Referenced by analyze_audio().

◆ get_video_ext_info()

int get_video_ext_info ( ringbuffer rbuf,
sequence_t s,
int  off,
int  le 
)

Definition at line 588 of file element.c.

Referenced by analyze_video().