@@ -317,8 +317,32 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
317
317
int64_t frame_id,
318
318
bool is_keyframe,
319
319
RTPVideoHeader* rtp_video_header) {
320
- if (codec_specific_info && codec_specific_info->generic_frame_info &&
320
+
321
+ #ifdef WEBRTC_USE_H265
322
+ if (codec_specific_info->codecType == webrtc::kVideoCodecH265 &&
323
+ codec_specific_info->codecSpecific .H265 .picture_id > 0 ) {
324
+ // H265ToGeneric implementation. Only set it when picture id is valid.
325
+ rtp_video_header->generic ->frame_id =
326
+ codec_specific_info->codecSpecific .H265 .picture_id ;
327
+ rtp_video_header->generic ->discardable =
328
+ codec_specific_info->codecSpecific .H265 .discardable ;
329
+ rtp_video_header->generic ->spatial_index = 0 ; // Not enabled at present.
330
+ rtp_video_header->generic ->temporal_index = 0 ; // Not enabled at present.
331
+ for (int dep_idx = 0 ; dep_idx < 5 ; dep_idx++) {
332
+ if (codec_specific_info->codecSpecific .H265 .dependencies [dep_idx] <= 0 )
333
+ break ;
334
+ rtp_video_header->generic ->dependencies [dep_idx] =
335
+ codec_specific_info->codecSpecific .H265 .dependencies [dep_idx];
336
+ }
337
+ // Not filling DTIs at present.
338
+ rtp_video_header->generic ->discardable =
339
+ codec_specific_info->codecSpecific .H265 .discardable ;
340
+ return ;
341
+ }
342
+ #else
343
+ if (codec_specific_info && codec_specific_info->generic_frame_info &&
321
344
!codec_specific_info->generic_frame_info ->encoder_buffers .empty ()) {
345
+ // If generic frame info is provided for other codecs, use generic frame info.
322
346
if (is_keyframe) {
323
347
// Key frame resets all chains it is in.
324
348
chains_calculator_.Reset (
@@ -328,6 +352,8 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
328
352
*codec_specific_info->generic_frame_info , frame_id);
329
353
return ;
330
354
}
355
+ #endif
356
+
331
357
332
358
switch (rtp_video_header->codec ) {
333
359
case VideoCodecType::kVideoCodecGeneric :
@@ -355,6 +381,7 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
355
381
}
356
382
return ;
357
383
#ifndef DISABLE_H265
384
+ // No further special handling for H.265
358
385
case VideoCodecType::kVideoCodecH265 :
359
386
#endif
360
387
case VideoCodecType::kVideoCodecMultiplex :
0 commit comments