FFmpeg
Loading...
Searching...
No Matches
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 "libavutil/mem.h"
#include "avformat.h"
#include "rtpdec.h"
#include "rtpdec_formats.h"

Go to the source code of this file.

Data Structures

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

Macros

#define COUNT_NAL_TYPE(data, nal)
 
#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 )
Value:
do { } while (0)

Definition at line 61 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

◆ NAL_COUNTERS

#define NAL_COUNTERS   NULL

Definition at line 62 of file rtpdec_h264.c.

Referenced by h264_handle_packet().

◆ NAL_MASK

#define NAL_MASK   0x1f

Definition at line 64 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 68 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 97 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 145 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 185 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 207 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 265 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 286 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 313 of file rtpdec_h264.c.

◆ h264_close_context()

static void h264_close_context ( PayloadContext * data)
static

Definition at line 377 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 390 of file rtpdec_h264.c.

Variable Documentation

◆ start_sequence

◆ 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,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
@ AVSTREAM_PARSE_FULL
full parsing and repack
Definition avformat.h:611
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:1178
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
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 int parse_h264_sdp_line(AVFormatContext *s, int st_index, PayloadContext *h264_data, const char *line)
static void h264_close_context(PayloadContext *data)
RTP/AV1 specific private data.
Definition rdt.c:85

Definition at line 412 of file rtpdec_h264.c.