video/payload_router.cc
// Map information from info into rtp.
Map information from info into rtp.
Map information from info into rtp .
void CopyCodecSpecific(const CodecSpecificInfo* info, RTPVideoHeader* rtp) {
  RTC_DCHECK(info);
  switch (info->codecType) {
    case kVideoCodecVP8: {
      rtp->codec = kRtpVideoVp8;
      rtp->codecHeader.VP8.InitRTPVideoHeaderVP8();
      rtp->codecHeader.VP8.pictureId = info->codecSpecific.VP8.pictureId;
      rtp->codecHeader.VP8.nonReference = info->codecSpecific.VP8.nonReference;
      rtp->codecHeader.VP8.temporalIdx = info->codecSpecific.VP8.temporalIdx;
      rtp->codecHeader.VP8.layerSync = info->codecSpecific.VP8.layerSync;
      rtp->codecHeader.VP8.tl0PicIdx = info->codecSpecific.VP8.tl0PicIdx;
      rtp->codecHeader.VP8.keyIdx = info->codecSpecific.VP8.keyIdx;
      rtp->simulcastIdx = info->codecSpecific.VP8.simulcastIdx;
      return;
    }
    case kVideoCodecVP9: {
      rtp->codec = kRtpVideoVp9;
      rtp->codecHeader.VP9.InitRTPVideoHeaderVP9();
      rtp->codecHeader.VP9.inter_pic_predicted =
          info->codecSpecific.VP9.inter_pic_predicted;
      rtp->codecHeader.VP9.flexible_mode =
          info->codecSpecific.VP9.flexible_mode;
      rtp->codecHeader.VP9.ss_data_available =
          info->codecSpecific.VP9.ss_data_available;
      rtp->codecHeader.VP9.picture_id = info->codecSpecific.VP9.picture_id;
      rtp->codecHeader.VP9.tl0_pic_idx = info->codecSpecific.VP9.tl0_pic_idx;
      rtp->codecHeader.VP9.temporal_idx = info->codecSpecific.VP9.temporal_idx;
      rtp->codecHeader.VP9.spatial_idx = info->codecSpecific.VP9.spatial_idx;
      rtp->codecHeader.VP9.temporal_up_switch =
          info->codecSpecific.VP9.temporal_up_switch;
      rtp->codecHeader.VP9.inter_layer_predicted =
          info->codecSpecific.VP9.inter_layer_predicted;
      rtp->codecHeader.VP9.gof_idx = info->codecSpecific.VP9.gof_idx;
      rtp->codecHeader.VP9.num_spatial_layers =
          info->codecSpecific.VP9.num_spatial_layers;
      if (info->codecSpecific.VP9.ss_data_available) {
        rtp->codecHeader.VP9.spatial_layer_resolution_present =
            info->codecSpecific.VP9.spatial_layer_resolution_present;
        if (info->codecSpecific.VP9.spatial_layer_resolution_present) {
          for (size_t i = 0; i < info->codecSpecific.VP9.num_spatial_layers;
               ++i) {
            rtp->codecHeader.VP9.width[i] = info->codecSpecific.VP9.width[i];
            rtp->codecHeader.VP9.height[i] = info->codecSpecific.VP9.height[i];
          }
        }
        rtp->codecHeader.VP9.gof.CopyGofInfoVP9(info->codecSpecific.VP9.gof);
      }
      rtp->codecHeader.VP9.num_ref_pics = info->codecSpecific.VP9.num_ref_pics;
      for (int i = 0; i < info->codecSpecific.VP9.num_ref_pics; ++i)
        rtp->codecHeader.VP9.pid_diff[i] = info->codecSpecific.VP9.p_diff[i];
      return;
    }
    case kVideoCodecH264:
      rtp->codec = kRtpVideoH264;
      rtp->codecHeader.H264.packetization_mode =
          info->codecSpecific.H264.packetization_mode;
      return;
    case kVideoCodecGeneric:
      rtp->codec = kRtpVideoGeneric;
      rtp->simulcastIdx = info->codecSpecific.generic.simulcast_idx;
      return;
    default:
      return;
  }
}
void CopyCodecSpecific ( const CodecSpecificInfo * info , RTPVideoHeader * rtp ) { RTC_DCHECK ( info ) ; switch ( info -> codecType ) { case kVideoCodecVP8 : { rtp -> codec = kRtpVideoVp8 ; rtp -> codecHeader . VP8 . InitRTPVideoHeaderVP8 ( ) ; rtp -> codecHeader . VP8 . pictureId = info -> codecSpecific . VP8 . pictureId ; rtp -> codecHeader . VP8 . nonReference = info -> codecSpecific . VP8 . nonReference ; rtp -> codecHeader . VP8 . temporalIdx = info -> codecSpecific . VP8 . temporalIdx ; rtp -> codecHeader . VP8 . layerSync = info -> codecSpecific . VP8 . layerSync ; rtp -> codecHeader . VP8 . tl0PicIdx = info -> codecSpecific . VP8 . tl0PicIdx ; rtp -> codecHeader . VP8 . keyIdx = info -> codecSpecific . VP8 . keyIdx ; rtp -> simulcastIdx = info -> codecSpecific . VP8 . simulcastIdx ; return ; } case kVideoCodecVP9 : { rtp -> codec = kRtpVideoVp9 ; rtp -> codecHeader . VP9 . InitRTPVideoHeaderVP9 ( ) ; rtp -> codecHeader . VP9 . inter_pic_predicted = info -> codecSpecific . VP9 . inter_pic_predicted ; rtp -> codecHeader . VP9 . flexible_mode = info -> codecSpecific . VP9 . flexible_mode ; rtp -> codecHeader . VP9 . ss_data_available = info -> codecSpecific . VP9 . ss_data_available ; rtp -> codecHeader . VP9 . picture_id = info -> codecSpecific . VP9 . picture_id ; rtp -> codecHeader . VP9 . tl0_pic_idx = info -> codecSpecific . VP9 . tl0_pic_idx ; rtp -> codecHeader . VP9 . temporal_idx = info -> codecSpecific . VP9 . temporal_idx ; rtp -> codecHeader . VP9 . spatial_idx = info -> codecSpecific . VP9 . spatial_idx ; rtp -> codecHeader . VP9 . temporal_up_switch = info -> codecSpecific . VP9 . temporal_up_switch ; rtp -> codecHeader . VP9 . inter_layer_predicted = info -> codecSpecific . VP9 . inter_layer_predicted ; rtp -> codecHeader . VP9 . gof_idx = info -> codecSpecific . VP9 . gof_idx ; rtp -> codecHeader . VP9 . num_spatial_layers = info -> codecSpecific . VP9 . num_spatial_layers ; if ( info -> codecSpecific . VP9 . ss_data_available ) { rtp -> codecHeader . VP9 . spatial_layer_resolution_present = info -> codecSpecific . VP9 . spatial_layer_resolution_present ; if ( info -> codecSpecific . VP9 . spatial_layer_resolution_present ) { for ( size_t i = 0 ; i < info -> codecSpecific . VP9 . num_spatial_layers ; ++ i ) { rtp -> codecHeader . VP9 . width [ i ] = info -> codecSpecific . VP9 . width [ i ] ; rtp -> codecHeader . VP9 . height [ i ] = info -> codecSpecific . VP9 . height [ i ] ; } } rtp -> codecHeader . VP9 . gof . CopyGofInfoVP9 ( info -> codecSpecific . VP9 . gof ) ; } rtp -> codecHeader . VP9 . num_ref_pics = info -> codecSpecific . VP9 . num_ref_pics ; for ( int i = 0 ; i < info -> codecSpecific . VP9 . num_ref_pics ; ++ i ) rtp -> codecHeader . VP9 . pid_diff [ i ] = info -> codecSpecific . VP9 . p_diff [ i ] ; return ; } case kVideoCodecH264 : rtp -> codec = kRtpVideoH264 ; rtp -> codecHeader . H264 . packetization_mode = info -> codecSpecific . H264 . packetization_mode ; return ; case kVideoCodecGeneric : rtp -> codec = kRtpVideoGeneric ; rtp -> simulcastIdx = info -> codecSpecific . generic . simulcast_idx ; return ; default : return ; } }
Map information from info into rtp.
Map information from info into rtp .