29 #define RTP_HEVC_PAYLOAD_HEADER_SIZE 2 30 #define RTP_HEVC_FU_HEADER_SIZE 1 31 #define RTP_HEVC_DONL_FIELD_SIZE 2 32 #define RTP_HEVC_DOND_FIELD_SIZE 1 33 #define HEVC_SPECIFIED_NAL_UNIT_TYPES 48 48 const char *attr,
const char *value)
52 if (!strcmp(attr,
"profile-id")) {
69 if (!strcmp(attr,
"sprop-vps") || !strcmp(attr,
"sprop-sps") ||
70 !strcmp(attr,
"sprop-pps") || !strcmp(attr,
"sprop-sei")) {
73 if (!strcmp(attr,
"sprop-vps")) {
74 data_ptr = &hevc_data->
vps;
76 }
else if (!strcmp(attr,
"sprop-sps")) {
77 data_ptr = &hevc_data->
sps;
79 }
else if (!strcmp(attr,
"sprop-pps")) {
80 data_ptr = &hevc_data->
pps;
82 }
else if (!strcmp(attr,
"sprop-sei")) {
83 data_ptr = &hevc_data->
sei;
101 if (!strcmp(attr,
"sprop-max-don-diff")) {
109 if (!strcmp(attr,
"sprop-depack-buf-nalus")) {
112 av_log(s,
AV_LOG_TRACE,
"Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
131 const char *sdp_line_ptr = line;
136 current_stream = ctx->
streams[st_index];
139 if (
av_strstart(sdp_line_ptr,
"framesize:", &sdp_line_ptr)) {
141 }
else if (
av_strstart(sdp_line_ptr,
"fmtp:", &sdp_line_ptr)) {
142 int ret =
ff_parse_fmtp(ctx, current_stream, hevc_data, sdp_line_ptr,
188 int tid, lid, nal_type;
189 int first_fragment, last_fragment, fu_type;
213 nal_type = (buf[0] >> 1) & 0x3f;
214 lid = ((buf[0] << 5) & 0x20) | ((buf[1] >> 3) & 0x1f);
293 first_fragment = buf[0] & 0x80;
294 last_fragment = buf[0] & 0x40;
295 fu_type = buf[0] & 0x3f;
312 "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
317 if (first_fragment && last_fragment) {
322 new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
323 new_nal_header[1] = rtp_pl[1];
326 new_nal_header,
sizeof(new_nal_header));
#define RTP_HEVC_DOND_FIELD_SIZE
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const uint8_t start_sequence[]
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, PayloadContext *hevc_data, const char *line)
This struct describes the properties of an encoded stream.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, AVStream *stream, PayloadContext *hevc_data, const char *attr, const char *value)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
AVStream ** streams
A list of all streams in the file.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
uint32_t timestamp
current frame timestamp
#define RTP_HEVC_FU_HEADER_SIZE
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int extradata_size
Size of the extradata content in bytes.
RTPDynamicProtocolHandler ff_hevc_dynamic_handler
static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
#define RTP_HEVC_PAYLOAD_HEADER_SIZE
uint8_t * buf
the temporary storage buffer
int ff_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value))
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define RTP_HEVC_DONL_FIELD_SIZE
AVCodecParameters * codecpar
This structure stores compressed data.