FFmpeg
Data Structures | Macros | Functions | Variables
rtpdec_mpeg4.c File Reference

MPEG-4 / RTP Code. More...

#include "rtpdec_formats.h"
#include "internal.h"
#include "libavutil/attributes.h"
#include "libavutil/avstring.h"
#include "libavcodec/get_bits.h"

Go to the source code of this file.

Data Structures

struct  PayloadContext
 RTP/JPEG specific private data. More...
 
struct  PayloadContext::AUHeaders
 mpeg 4 AU headers More...
 
struct  AttrNameMap
 
struct  AttrNameMap::Range
 Range for integer values. More...
 

Macros

#define MAX_AAC_HBR_FRAME_SIZE   8191
 
#define ATTR_NAME_TYPE_INT   0
 
#define ATTR_NAME_TYPE_STR   1
 

Functions

static void close_context (PayloadContext *data)
 
static int parse_fmtp_config (AVCodecParameters *par, const char *value)
 
static int rtp_parse_mp4_au (PayloadContext *data, const uint8_t *buf, int len)
 
static int aac_parse_packet (AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
 
static int parse_fmtp (AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value)
 
static int parse_sdp_line (AVFormatContext *s, int st_index, PayloadContext *data, const char *line)
 

Variables

static const AttrNameMap attr_names []
 
const RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler
 
const RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler
 

Detailed Description

MPEG-4 / RTP Code.

Author
Fabrice Bellard
Romain Degez

Definition in file rtpdec_mpeg4.c.

Macro Definition Documentation

◆ MAX_AAC_HBR_FRAME_SIZE

#define MAX_AAC_HBR_FRAME_SIZE   8191

Definition at line 36 of file rtpdec_mpeg4.c.

◆ ATTR_NAME_TYPE_INT

#define ATTR_NAME_TYPE_INT   0

Definition at line 82 of file rtpdec_mpeg4.c.

◆ ATTR_NAME_TYPE_STR

#define ATTR_NAME_TYPE_STR   1

Definition at line 83 of file rtpdec_mpeg4.c.

Function Documentation

◆ close_context()

static void close_context ( PayloadContext data)
static

Definition at line 106 of file rtpdec_mpeg4.c.

◆ parse_fmtp_config()

static int parse_fmtp_config ( AVCodecParameters par,
const char *  value 
)
static

Definition at line 112 of file rtpdec_mpeg4.c.

Referenced by parse_fmtp().

◆ rtp_parse_mp4_au()

static int rtp_parse_mp4_au ( PayloadContext data,
const uint8_t *  buf,
int  len 
)
static

Definition at line 123 of file rtpdec_mpeg4.c.

Referenced by aac_parse_packet().

◆ aac_parse_packet()

static int aac_parse_packet ( AVFormatContext ctx,
PayloadContext data,
AVStream st,
AVPacket pkt,
uint32_t *  timestamp,
const uint8_t *  buf,
int  len,
uint16_t  seq,
int  flags 
)
static

Definition at line 173 of file rtpdec_mpeg4.c.

◆ parse_fmtp()

static int parse_fmtp ( AVFormatContext s,
AVStream stream,
PayloadContext data,
const char *  attr,
const char *  value 
)
static

Definition at line 285 of file rtpdec_mpeg4.c.

Referenced by parse_sdp_line().

◆ parse_sdp_line()

static int parse_sdp_line ( AVFormatContext s,
int  st_index,
PayloadContext data,
const char *  line 
)
static

Definition at line 335 of file rtpdec_mpeg4.c.

Variable Documentation

◆ attr_names

const AttrNameMap attr_names[]
static
Initial value:
= {
{ "SizeLength", ATTR_NAME_TYPE_INT,
0x42,
{0, 32} },
{ "IndexLength", ATTR_NAME_TYPE_INT,
0x42,
{0, 32} },
{ "IndexDeltaLength", ATTR_NAME_TYPE_INT,
0x42,
{0, 32} },
{ "profile-level-id", ATTR_NAME_TYPE_INT,
0x42,
{INT32_MIN, INT32_MAX} },
{ "StreamType", ATTR_NAME_TYPE_INT,
0x42,
{0x00, 0x3F} },
{ "mode", ATTR_NAME_TYPE_STR,
0x42,
{0} },
{ NULL, -1, -1, {0} },
}

Definition at line 84 of file rtpdec_mpeg4.c.

Referenced by parse_fmtp().

◆ ff_mp4v_es_dynamic_handler

const RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler
Initial value:
= {
.enc_name = "MP4V-ES",
.codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_MPEG4,
.need_parsing = AVSTREAM_PARSE_FULL,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_sdp_line,
}

Definition at line 349 of file rtpdec_mpeg4.c.

◆ ff_mpeg4_generic_dynamic_handler

const RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler
Initial value:
= {
.enc_name = "mpeg4-generic",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_sdp_line,
.close = close_context,
}

Definition at line 358 of file rtpdec_mpeg4.c.

AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:62
close_context
static void close_context(PayloadContext *data)
Definition: rtpdec_mpeg4.c:106
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:425
aac_parse_packet
static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
Definition: rtpdec_mpeg4.c:173
ATTR_NAME_TYPE_INT
#define ATTR_NAME_TYPE_INT
Definition: rtpdec_mpeg4.c:82
ATTR_NAME_TYPE_STR
#define ATTR_NAME_TYPE_STR
Definition: rtpdec_mpeg4.c:83
parse_sdp_line
static int parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data, const char *line)
Definition: rtpdec_mpeg4.c:335
parse_packet
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index, int flush)
Parse a packet, add all split parts to parse_queue.
Definition: demux.c:1105
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVSTREAM_PARSE_FULL
@ AVSTREAM_PARSE_FULL
full parsing and repack
Definition: avformat.h:792
PayloadContext
RTP/JPEG specific private data.
Definition: rdt.c:83