MythTV  master
Macros | Functions
replex.cpp File Reference
#include <stdlib.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "replex.h"
#include "pes.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "mythlogging.h"
Include dependency graph for replex.cpp:

Go to the source code of this file.

Macros

#define O_LARGEFILE   0
 
#define S_IRGRP   0
 
#define S_IWGRP   0
 
#define S_IROTH   0
 
#define S_IWOTH   0
 
#define LIMIT   3
 
#define IN_SIZE   (1000*TS_SIZE)
 
#define MAXVPID   16
 
#define MAXAPID   32
 
#define MAXAC3PID   16
 
#define MAX_TRIES   5
 
#define AVI_S   1024
 

Functions

static int replex_all_set (struct replex *rx)
 
static int replex_check_id (struct replex *rx, uint16_t id)
 
static int avcodec_encode_audio (AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)
 
static int encode_mp2_audio (audio_frame_t *aframe, uint8_t *buffer, int bufsize)
 
static void analyze_audio (pes_in_t *p, struct replex *rx, int len, int num, int type)
 
static void analyze_video (pes_in_t *p, struct replex *rx, int len)
 
static void es_out (pes_in_t *p)
 
static void pes_es_out (pes_in_t *p)
 
static void avi_es_out (pes_in_t *p)
 
static int replex_tsp (struct replex *rx, uint8_t *tsp)
 
static ssize_t save_read (struct replex *rx, void *buf, size_t count)
 
static int guess_fill (struct replex *rx)
 
static void find_pids_file (struct replex *rx)
 
static void find_all_pids_file (struct replex *rx)
 
static void find_pids_stdin (struct replex *rx, uint8_t *buf, int len)
 
static void pes_id_out (pes_in_t *p)
 
static void find_pes_ids (struct replex *rx)
 
static void replex_finish (struct replex *rx)
 
static int replex_fill_buffers (struct replex *rx, uint8_t *mbuf)
 
static int fill_buffers (void *r, int finish)
 
void init_index (index_unit *iu)
 
static int check_stream_type (struct replex *rx, uint8_t *buf, int len)
 
static void init_replex (struct replex *rx)
 
static void fix_audio (struct replex *rx, multiplex_t *mx)
 
static int get_next_video_unit (struct replex *rx, index_unit *viu)
 
static int get_next_audio_unit (struct replex *rx, index_unit *aiu, int i)
 
static int get_next_ac3_unit (struct replex *rx, index_unit *aiu, int i)
 
static void do_analyze (struct replex *rx)
 
static void do_scan (struct replex *rx)
 
static void do_demux (struct replex *rx)
 
static void do_replex (struct replex *rx)
 
static void usage (char *progname)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ O_LARGEFILE

#define O_LARGEFILE   0

Definition at line 46 of file replex.cpp.

◆ S_IRGRP

#define S_IRGRP   0

Definition at line 55 of file replex.cpp.

◆ S_IWGRP

#define S_IWGRP   0

Definition at line 56 of file replex.cpp.

◆ S_IROTH

#define S_IROTH   0

Definition at line 57 of file replex.cpp.

◆ S_IWOTH

#define S_IWOTH   0

Definition at line 58 of file replex.cpp.

◆ LIMIT

#define LIMIT   3

◆ IN_SIZE

#define IN_SIZE   (1000*TS_SIZE)

Definition at line 1291 of file replex.cpp.

◆ MAXVPID

#define MAXVPID   16

Definition at line 1344 of file replex.cpp.

◆ MAXAPID

#define MAXAPID   32

Definition at line 1345 of file replex.cpp.

◆ MAXAC3PID

#define MAXAC3PID   16

Definition at line 1346 of file replex.cpp.

◆ MAX_TRIES

#define MAX_TRIES   5

◆ AVI_S

#define AVI_S   1024

Function Documentation

◆ replex_all_set()

static int replex_all_set ( struct replex rx)
static

Definition at line 1851 of file replex.cpp.

Referenced by do_replex(), and replex_finish().

◆ replex_check_id()

static int replex_check_id ( struct replex rx,
uint16_t  id 
)
static

Definition at line 69 of file replex.cpp.

Referenced by replex_tsp().

◆ avcodec_encode_audio()

static int avcodec_encode_audio ( AVCodecContext *  avctx,
uint8_t *  buf,
int  buf_size,
const short *  samples 
)
static

Definition at line 87 of file replex.cpp.

Referenced by encode_mp2_audio().

◆ encode_mp2_audio()

static int encode_mp2_audio ( audio_frame_t aframe,
uint8_t *  buffer,
int  bufsize 
)
static

Definition at line 174 of file replex.cpp.

Referenced by analyze_audio().

◆ analyze_audio()

static void analyze_audio ( pes_in_t p,
struct replex rx,
int  len,
int  num,
int  type 
)
static

Definition at line 233 of file replex.cpp.

Referenced by avi_es_out(), es_out(), and pes_es_out().

◆ analyze_video()

static void analyze_video ( pes_in_t p,
struct replex rx,
int  len 
)
static

Definition at line 509 of file replex.cpp.

Referenced by avi_es_out(), es_out(), and pes_es_out().

◆ es_out()

static void es_out ( pes_in_t p)
static

Definition at line 912 of file replex.cpp.

Referenced by replex_tsp().

◆ pes_es_out()

static void pes_es_out ( pes_in_t p)
static

Definition at line 982 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ avi_es_out()

static void avi_es_out ( pes_in_t p)
static

Definition at line 1094 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ replex_tsp()

static int replex_tsp ( struct replex rx,
uint8_t *  tsp 
)
static

Definition at line 1163 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ save_read()

static ssize_t save_read ( struct replex rx,
void *  buf,
size_t  count 
)
static

◆ guess_fill()

static int guess_fill ( struct replex rx)
static

Definition at line 1247 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ find_pids_file()

static void find_pids_file ( struct replex rx)
static

Definition at line 1292 of file replex.cpp.

Referenced by init_replex().

◆ find_all_pids_file()

static void find_all_pids_file ( struct replex rx)
static

Definition at line 1347 of file replex.cpp.

Referenced by do_scan().

◆ find_pids_stdin()

static void find_pids_stdin ( struct replex rx,
uint8_t *  buf,
int  len 
)
static

Definition at line 1439 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ pes_id_out()

static void pes_id_out ( pes_in_t p)
static

Definition at line 1502 of file replex.cpp.

Referenced by find_pes_ids().

◆ find_pes_ids()

static void find_pes_ids ( struct replex rx)
static

Definition at line 1564 of file replex.cpp.

Referenced by do_scan().

◆ replex_finish()

static void replex_finish ( struct replex rx)
static

Definition at line 1673 of file replex.cpp.

Referenced by replex_fill_buffers().

◆ replex_fill_buffers()

static int replex_fill_buffers ( struct replex rx,
uint8_t *  mbuf 
)
static

Definition at line 1689 of file replex.cpp.

Referenced by do_analyze(), do_demux(), do_replex(), fill_buffers(), fix_audio(), and init_replex().

◆ fill_buffers()

static int fill_buffers ( void *  r,
int  finish 
)
static

Definition at line 1835 of file replex.cpp.

Referenced by do_replex(), and init_multiplex().

◆ init_index()

void init_index ( index_unit iu)

Definition at line 1845 of file replex.cpp.

Referenced by analyze_audio(), analyze_video(), find_pids_stdin(), and init_replex().

◆ check_stream_type()

static int check_stream_type ( struct replex rx,
uint8_t *  buf,
int  len 
)
static

Definition at line 1869 of file replex.cpp.

Referenced by do_scan(), and init_replex().

◆ init_replex()

static void init_replex ( struct replex rx)
static

Definition at line 1918 of file replex.cpp.

Referenced by main().

◆ fix_audio()

static void fix_audio ( struct replex rx,
multiplex_t mx 
)
static

Definition at line 2068 of file replex.cpp.

Referenced by do_replex().

◆ get_next_video_unit()

static int get_next_video_unit ( struct replex rx,
index_unit viu 
)
static

Definition at line 2128 of file replex.cpp.

Referenced by do_analyze(), and do_demux().

◆ get_next_audio_unit()

static int get_next_audio_unit ( struct replex rx,
index_unit aiu,
int  i 
)
static

Definition at line 2138 of file replex.cpp.

Referenced by do_analyze(), and do_demux().

◆ get_next_ac3_unit()

static int get_next_ac3_unit ( struct replex rx,
index_unit aiu,
int  i 
)
static

Definition at line 2148 of file replex.cpp.

Referenced by do_analyze(), and do_demux().

◆ do_analyze()

static void do_analyze ( struct replex rx)
static

Definition at line 2160 of file replex.cpp.

Referenced by main().

◆ do_scan()

static void do_scan ( struct replex rx)
static

Definition at line 2273 of file replex.cpp.

Referenced by main(), and ScanWizard::Scan().

◆ do_demux()

static void do_demux ( struct replex rx)
static

Definition at line 2303 of file replex.cpp.

Referenced by main().

◆ do_replex()

static void do_replex ( struct replex rx)
static

Definition at line 2340 of file replex.cpp.

Referenced by main().

◆ usage()

static void usage ( char *  progname)
static

Definition at line 2398 of file replex.cpp.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 2421 of file replex.cpp.