@@ -315,21 +315,6 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
315
315
int64_t frame_id,
316
316
bool is_keyframe,
317
317
RTPVideoHeader* rtp_video_header) {
318
- if (codec_specific_info->codecType == webrtc::kVideoCodecH265 &&
319
- codec_specific_info->codecSpecific .H265 .picture_id > 0 ) {
320
- // H265ToGeneric implementation. Only set it when picture id is valid.
321
- rtp_video_header->generic ->frame_id =
322
- codec_specific_info->codecSpecific .H265 .picture_id ;
323
- rtp_video_header->generic ->spatial_index = 0 ; // Not enabled at present.
324
- rtp_video_header->generic ->temporal_index = 0 ; // Not enabled at present.
325
- for (int dep_idx = 0 ; dep_idx < 5 ; dep_idx++) {
326
- if (codec_specific_info->codecSpecific .H265 .dependencies [dep_idx] <= 0 )
327
- break ;
328
- rtp_video_header->generic ->dependencies [dep_idx] =
329
- codec_specific_info->codecSpecific .H265 .dependencies [dep_idx];
330
- }
331
- return ;
332
- }
333
318
if (codec_specific_info && codec_specific_info->generic_frame_info &&
334
319
!codec_specific_info->generic_frame_info ->encoder_buffers .empty ()) {
335
320
// If generic frame info is provided for other codecs, use generic frame
@@ -369,8 +354,12 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
369
354
is_keyframe, rtp_video_header);
370
355
}
371
356
return ;
372
- // No further special handling for H.265
373
357
case VideoCodecType::kVideoCodecH265 :
358
+ if (codec_specific_info) {
359
+ H265ToGeneric (codec_specific_info->codecSpecific .H265 , frame_id,
360
+ is_keyframe, rtp_video_header);
361
+ }
362
+ return ;
374
363
case VideoCodecType::kVideoCodecMultiplex :
375
364
return ;
376
365
}
@@ -517,6 +506,26 @@ void RtpPayloadParams::H264ToGeneric(const CodecSpecificInfoH264& h264_info,
517
506
last_shared_frame_id_[/* spatial_index*/ 0 ][temporal_index] = shared_frame_id;
518
507
}
519
508
509
+ void RtpPayloadParams::H265ToGeneric (const CodecSpecificInfoH265& h265_info,
510
+ int64_t shared_frame_id,
511
+ bool is_keyframe,
512
+ RTPVideoHeader* rtp_video_header) {
513
+ if (h265_info.picture_id <= 0 ) {
514
+ RTC_LOG (LS_WARNING) << " Invalid HEVC picture ID." ;
515
+ return ;
516
+ }
517
+ RTPVideoHeader::GenericDescriptorInfo& generic =
518
+ rtp_video_header->generic .emplace ();
519
+ generic.frame_id = h265_info.picture_id ;
520
+ generic.spatial_index = 0 ; // Not enabled at present.
521
+ generic.temporal_index = 0 ; // Not enabled at present.
522
+ for (int dep_idx = 0 ; dep_idx < 5 ; dep_idx++) {
523
+ if (h265_info.dependencies [dep_idx] <= 0 )
524
+ break ;
525
+ generic.dependencies [dep_idx] = h265_info.dependencies [dep_idx];
526
+ }
527
+ }
528
+
520
529
void RtpPayloadParams::Vp8ToGeneric (const CodecSpecificInfoVP8& vp8_info,
521
530
int64_t shared_frame_id,
522
531
bool is_keyframe,
0 commit comments