32 #define RTP_HEVC_PAYLOAD_HEADER_SIZE 2
33 #define RTP_HEVC_FU_HEADER_SIZE 1
34 #define RTP_HEVC_DONL_FIELD_SIZE 2
35 #define RTP_HEVC_DOND_FIELD_SIZE 1
36 #define RTP_HEVC_AP_NALU_LENGTH_FIELD_SIZE 2
37 #define HEVC_SPECIFIED_NAL_UNIT_TYPES 48
52 const char *attr,
const char *
value)
56 if (!strcmp(attr,
"profile-id")) {
73 if (!strcmp(attr,
"sprop-vps") || !strcmp(attr,
"sprop-sps") ||
74 !strcmp(attr,
"sprop-pps") || !strcmp(attr,
"sprop-sei")) {
77 if (!strcmp(attr,
"sprop-vps")) {
78 data_ptr = &hevc_data->
vps;
80 }
else if (!strcmp(attr,
"sprop-sps")) {
81 data_ptr = &hevc_data->
sps;
83 }
else if (!strcmp(attr,
"sprop-pps")) {
84 data_ptr = &hevc_data->
pps;
86 }
else if (!strcmp(attr,
"sprop-sei")) {
87 data_ptr = &hevc_data->
sei;
106 if (!strcmp(attr,
"sprop-max-don-diff")) {
109 av_dlog(s,
"Found sprop-max-don-diff in SDP, DON field usage is: %d\n",
114 if (!strcmp(attr,
"sprop-depack-buf-nalus")) {
117 av_dlog(s,
"Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
136 const char *sdp_line_ptr = line;
141 current_stream = ctx->
streams[st_index];
142 codec = current_stream->
codec;
144 if (
av_strstart(sdp_line_ptr,
"framesize:", &sdp_line_ptr)) {
146 }
else if (
av_strstart(sdp_line_ptr,
"fmtp:", &sdp_line_ptr)) {
193 int tid, lid, nal_type;
194 int first_fragment, last_fragment, fu_type;
218 nal_type = (buf[0] >> 1) & 0x3f;
219 lid = ((buf[0] << 5) & 0x20) | ((buf[1] >> 3) & 0x1f);
255 "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
306 first_fragment = buf[0] & 0x80;
307 last_fragment = buf[0] & 0x40;
308 fu_type = buf[0] & 0x3f;
320 av_dlog(ctx,
" FU type %d with %d bytes\n", fu_type, len);
326 "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
334 if (first_fragment && last_fragment) {
339 new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
340 new_nal_header[1] = rtp_pl[1];
343 new_nal_header,
sizeof(new_nal_header));