FFmpeg  4.0
Data Structures | Macros | Functions | Variables
rtpdec_h264.c File Reference

H.264 / RTP Code (RFC3984) More...

#include "libavutil/attributes.h"
#include "libavutil/base64.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "avformat.h"
#include "rtpdec.h"
#include "rtpdec_formats.h"

Go to the source code of this file.

Data Structures

struct  PayloadContext
 RTP/JPEG specific private data. More...
 

Macros

#define COUNT_NAL_TYPE(data, nal)   do { } while (0)
 
#define NAL_COUNTERS   NULL
 
#define NAL_MASK   0x1f
 

Functions

static void parse_profile_level_id (AVFormatContext *s, PayloadContext *h264_data, const char *value)
 
int ff_h264_parse_sprop_parameter_sets (AVFormatContext *s, uint8_t **data_ptr, int *size_ptr, const char *value)
 
static int sdp_parse_fmtp_config_h264 (AVFormatContext *s, AVStream *stream, PayloadContext *h264_data, const char *attr, const char *value)
 
void ff_h264_parse_framesize (AVCodecParameters *par, const char *p)
 
int ff_h264_handle_aggregated_packet (AVFormatContext *ctx, PayloadContext *data, AVPacket *pkt, const uint8_t *buf, int len, int skip_between, int *nal_counters, int nal_mask)
 
int ff_h264_handle_frag_packet (AVPacket *pkt, const uint8_t *buf, int len, int start_bit, const uint8_t *nal_header, int nal_header_len)
 
static int h264_handle_packet_fu_a (AVFormatContext *ctx, PayloadContext *data, AVPacket *pkt, const uint8_t *buf, int len, int *nal_counters, int nal_mask)
 
static int h264_handle_packet (AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
 
static void h264_close_context (PayloadContext *data)
 
static int parse_h264_sdp_line (AVFormatContext *s, int st_index, PayloadContext *h264_data, const char *line)
 

Variables

static const uint8_t start_sequence [] = { 0, 0, 0, 1 }
 
const RTPDynamicProtocolHandler ff_h264_dynamic_handler
 

Detailed Description

H.264 / RTP Code (RFC3984)

Author
Ryan Martell rdm4@.nosp@m.mart.nosp@m.ellve.nosp@m.ntur.nosp@m.es.co.nosp@m.m
Note
Notes: Notes: This currently supports packetization mode: Single Nal Unit Mode (0), or Non-Interleaved Mode (1). It currently does not support Interleaved Mode (2). (This requires implementing STAP-B, MTAP16, MTAP24, FU-B packet types)

Definition in file rtpdec_h264.c.

Macro Definition Documentation

◆ COUNT_NAL_TYPE

#define COUNT_NAL_TYPE (   data,
  nal 
)    do { } while (0)

Definition at line 60 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

◆ NAL_COUNTERS

#define NAL_COUNTERS   NULL

Definition at line 61 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

◆ NAL_MASK

#define NAL_MASK   0x1f

Definition at line 63 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

Function Documentation

◆ parse_profile_level_id()

static void parse_profile_level_id ( AVFormatContext s,
PayloadContext h264_data,
const char *  value 
)
static

Definition at line 67 of file rtpdec_h264.c.

Referenced by sdp_parse_fmtp_config_h264().

◆ ff_h264_parse_sprop_parameter_sets()

int ff_h264_parse_sprop_parameter_sets ( AVFormatContext s,
uint8_t **  data_ptr,
int size_ptr,
const char *  value 
)

Definition at line 96 of file rtpdec_h264.c.

Referenced by hevc_sdp_parse_fmtp_config(), and sdp_parse_fmtp_config_h264().

◆ sdp_parse_fmtp_config_h264()

static int sdp_parse_fmtp_config_h264 ( AVFormatContext s,
AVStream stream,
PayloadContext h264_data,
const char *  attr,
const char *  value 
)
static

Definition at line 144 of file rtpdec_h264.c.

Referenced by parse_h264_sdp_line().

◆ ff_h264_parse_framesize()

void ff_h264_parse_framesize ( AVCodecParameters par,
const char *  p 
)

Definition at line 184 of file rtpdec_h264.c.

Referenced by hevc_parse_sdp_line(), and parse_h264_sdp_line().

◆ ff_h264_handle_aggregated_packet()

int ff_h264_handle_aggregated_packet ( AVFormatContext ctx,
PayloadContext data,
AVPacket pkt,
const uint8_t buf,
int  len,
int  skip_between,
int nal_counters,
int  nal_mask 
)

Definition at line 206 of file rtpdec_h264.c.

Referenced by h264_handle_packet(), and hevc_handle_packet().

◆ ff_h264_handle_frag_packet()

int ff_h264_handle_frag_packet ( AVPacket pkt,
const uint8_t buf,
int  len,
int  start_bit,
const uint8_t nal_header,
int  nal_header_len 
)

Definition at line 264 of file rtpdec_h264.c.

Referenced by h264_handle_packet_fu_a(), and hevc_handle_packet().

◆ h264_handle_packet_fu_a()

static int h264_handle_packet_fu_a ( AVFormatContext ctx,
PayloadContext data,
AVPacket pkt,
const uint8_t buf,
int  len,
int nal_counters,
int  nal_mask 
)
static

Definition at line 285 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

◆ h264_handle_packet()

static int h264_handle_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 312 of file rtpdec_h264.c.

◆ h264_close_context()

static void h264_close_context ( PayloadContext data)
static

Definition at line 376 of file rtpdec_h264.c.

◆ parse_h264_sdp_line()

static int parse_h264_sdp_line ( AVFormatContext s,
int  st_index,
PayloadContext h264_data,
const char *  line 
)
static

Definition at line 389 of file rtpdec_h264.c.

Variable Documentation

◆ start_sequence

const uint8_t start_sequence[] = { 0, 0, 0, 1 }
static

◆ ff_h264_dynamic_handler

const RTPDynamicProtocolHandler ff_h264_dynamic_handler
Initial value:
= {
.enc_name = "H264",
.codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_H264,
.need_parsing = AVSTREAM_PARSE_FULL,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_h264_sdp_line,
}
RTP/JPEG specific private data.
Definition: rdt.c:83
static void h264_close_context(PayloadContext *data)
Definition: rtpdec_h264.c:376
static int parse_h264_sdp_line(AVFormatContext *s, int st_index, PayloadContext *h264_data, const char *line)
Definition: rtpdec_h264.c:389
full parsing and repack
Definition: avformat.h:793
static int h264_handle_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_h264.c:312
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
Parse a packet, add all split parts to parse_queue.
Definition: utils.c:1437

Definition at line 411 of file rtpdec_h264.c.