FFmpeg
Loading...
Searching...
No Matches
rtpdec.c File Reference
#include <stdio.h>
#include <string.h>
#include "libavutil/mem.h"
#include "libavutil/intreadwrite.h"
#include "libavformat/avformat.h"
#include "libavformat/rtpdec.h"
#include "libavformat/rtpdec_formats.h"

Go to the source code of this file.

Data Structures

struct  Output
 

Macros

#define TS_SIZE   188
 
#define TS_PAYLOAD   184 /* TS_SIZE - 4-byte TS header */
 
#define TS_PER_RTP   7 /* 12 + 7*188 = 1328-byte RTP packets */
 
#define RTP_HEADER_SIZE   12
 
#define RTP_PAYLOAD   (TS_PER_RTP * TS_SIZE)
 
#define MP2T_PT   33 /* static RTP payload type for MPEG-2 TS*/
 
#define QUEUE_SIZE   2 /* reordering enabled, small jitter buf */
 
#define ES_PID   0x0100
 
#define PES_STREAM_ID   0xe0 /* a video stream id */
 
#define PES_HDR_SIZE   9 /* 00 00 01 id len(2) flags(2) hdrlen */
 
#define PES_TS_PACKETS   17
 
#define PES_ES_LEN   ((TS_PAYLOAD - PES_HDR_SIZE) + (PES_TS_PACKETS - 1) * TS_PAYLOAD)
 
#define NB_TS_PACKETS   35
 
#define NB_RTP_PACKETS   (NB_TS_PACKETS / TS_PER_RTP) /* 5 */
 
#define SEQ_BASE   100
 

Functions

static void put_ts_packet (uint8_t *dst, int pusi, int cc, const uint8_t *payload)
 
static void add_pes (uint8_t *ts, int *off, int *cc, int *es_counter, int es_len)
 
static void build_ts_stream (uint8_t *ts)
 
static void collect (AVPacket *pkt, Output *out)
 
static void feed (RTPDemuxContext *s, AVPacket *pkt, const uint8_t *ts_stream, int block, Output *out)
 
static int run (const uint8_t *ts_stream, const int *order, Output *out)
 
static void dump (const char *label, const Output *o)
 
int main (void)
 

Macro Definition Documentation

◆ TS_SIZE

#define TS_SIZE   188

Definition at line 62 of file rtpdec.c.

Referenced by add_pes(), and main().

◆ TS_PAYLOAD

#define TS_PAYLOAD   184 /* TS_SIZE - 4-byte TS header */

Definition at line 63 of file rtpdec.c.

Referenced by add_pes(), build_ts_stream(), and put_ts_packet().

◆ TS_PER_RTP

#define TS_PER_RTP   7 /* 12 + 7*188 = 1328-byte RTP packets */

Definition at line 64 of file rtpdec.c.

◆ RTP_HEADER_SIZE

#define RTP_HEADER_SIZE   12

Definition at line 65 of file rtpdec.c.

Referenced by feed().

◆ RTP_PAYLOAD

#define RTP_PAYLOAD   (TS_PER_RTP * TS_SIZE)

Definition at line 66 of file rtpdec.c.

Referenced by feed().

◆ MP2T_PT

#define MP2T_PT   33 /* static RTP payload type for MPEG-2 TS*/

Definition at line 67 of file rtpdec.c.

Referenced by feed(), and run().

◆ QUEUE_SIZE

#define QUEUE_SIZE   2 /* reordering enabled, small jitter buf */

Definition at line 68 of file rtpdec.c.

◆ ES_PID

#define ES_PID   0x0100

Definition at line 70 of file rtpdec.c.

Referenced by put_ts_packet().

◆ PES_STREAM_ID

#define PES_STREAM_ID   0xe0 /* a video stream id */

Definition at line 71 of file rtpdec.c.

Referenced by add_pes().

◆ PES_HDR_SIZE

#define PES_HDR_SIZE   9 /* 00 00 01 id len(2) flags(2) hdrlen */

Definition at line 72 of file rtpdec.c.

Referenced by add_pes(), and build_ts_stream().

◆ PES_TS_PACKETS

#define PES_TS_PACKETS   17

Definition at line 77 of file rtpdec.c.

◆ PES_ES_LEN

#define PES_ES_LEN   ((TS_PAYLOAD - PES_HDR_SIZE) + (PES_TS_PACKETS - 1) * TS_PAYLOAD)

Definition at line 78 of file rtpdec.c.

Referenced by build_ts_stream().

◆ NB_TS_PACKETS

#define NB_TS_PACKETS   35

Definition at line 86 of file rtpdec.c.

Referenced by main().

◆ NB_RTP_PACKETS

#define NB_RTP_PACKETS   (NB_TS_PACKETS / TS_PER_RTP) /* 5 */

Definition at line 87 of file rtpdec.c.

Referenced by main(), and run().

◆ SEQ_BASE

#define SEQ_BASE   100

Definition at line 91 of file rtpdec.c.

Referenced by feed().

Function Documentation

◆ put_ts_packet()

static void put_ts_packet ( uint8_t * dst,
int pusi,
int cc,
const uint8_t * payload )
static

Definition at line 104 of file rtpdec.c.

Referenced by add_pes().

◆ add_pes()

static void add_pes ( uint8_t * ts,
int * off,
int * cc,
int * es_counter,
int es_len )
static

Definition at line 115 of file rtpdec.c.

Referenced by build_ts_stream().

◆ build_ts_stream()

static void build_ts_stream ( uint8_t * ts)
static

Definition at line 144 of file rtpdec.c.

Referenced by main().

◆ collect()

static void collect ( AVPacket * pkt,
Output * out )
static

Definition at line 156 of file rtpdec.c.

Referenced by feed().

◆ feed()

static void feed ( RTPDemuxContext * s,
AVPacket * pkt,
const uint8_t * ts_stream,
int block,
Output * out )
static

Definition at line 171 of file rtpdec.c.

Referenced by run().

◆ run()

static int run ( const uint8_t * ts_stream,
const int * order,
Output * out )
static

Definition at line 199 of file rtpdec.c.

◆ dump()

static void dump ( const char * label,
const Output * o )
static

Definition at line 244 of file rtpdec.c.

Referenced by avfilter_graph_dump(), bands_dist(), lavfi_read_header(), and main().

◆ main()

int main ( void )

Definition at line 253 of file rtpdec.c.