@@ -315,21 +315,6 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
315315 int64_t frame_id,
316316 bool is_keyframe,
317317 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- }
333318 if (codec_specific_info && codec_specific_info->generic_frame_info &&
334319 !codec_specific_info->generic_frame_info ->encoder_buffers .empty ()) {
335320 // If generic frame info is provided for other codecs, use generic frame
@@ -369,8 +354,12 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
369354 is_keyframe, rtp_video_header);
370355 }
371356 return ;
372- // No further special handling for H.265
373357 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 ;
374363 case VideoCodecType::kVideoCodecMultiplex :
375364 return ;
376365 }
@@ -517,6 +506,26 @@ void RtpPayloadParams::H264ToGeneric(const CodecSpecificInfoH264& h264_info,
517506 last_shared_frame_id_[/* spatial_index*/ 0 ][temporal_index] = shared_frame_id;
518507}
519508
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+
520529void RtpPayloadParams::Vp8ToGeneric (const CodecSpecificInfoVP8& vp8_info,
521530 int64_t shared_frame_id,
522531 bool is_keyframe,
0 commit comments