@@ -179,6 +179,12 @@ bool VideoSendAdapterImpl::init()
179179 configuration.event_log = m_eventLog.get ();
180180 configuration.retransmission_rate_limiter = m_retransmissionRateLimiter.get ();
181181 configuration.local_media_ssrc = m_ssrc; // rtp_config.ssrcs[i];
182+ // TODO: enable UlpfecGenerator
183+ /*
184+ std::make_unique<UlpfecGenerator>(
185+ rtp.ulpfec.red_payload_type, rtp.ulpfec.ulpfec_payload_type, clock);
186+ configuration.fec_generator = fec_generator.get();
187+ */
182188
183189 m_rtpRtcp = webrtc::RtpRtcp::Create (configuration);
184190 m_rtpRtcp->SetSendingStatus (true );
@@ -202,21 +208,15 @@ bool VideoSendAdapterImpl::init()
202208 m_rtpRtcp->SetMaxRtpPacketSize (kMaxRtpPacketSize );
203209
204210 webrtc::RTPSenderVideo::Config video_config;
205- m_playoutDelayOracle = std::make_unique<webrtc::PlayoutDelayOracle>();
206211 m_fieldTrialConfig = std::make_unique<webrtc::FieldTrialBasedConfig>();
207212 video_config.clock = configuration.clock ;
208213 video_config.rtp_sender = m_rtpRtcp->RtpSender ();
209214 video_config.field_trials = m_fieldTrialConfig.get ();
210- video_config.playout_delay_oracle = m_playoutDelayOracle.get ();
211215 if (m_config.red_payload ) {
212216 video_config.red_payload_type = m_config.red_payload ;
213217 }
214- if (m_config.ulpfec_payload ) {
215- video_config.ulpfec_payload_type = m_config.ulpfec_payload ;
216- }
217218
218219 m_senderVideo = std::make_unique<webrtc::RTPSenderVideo>(video_config);
219- // m_params = std::make_unique<RtpPayloadParams>(m_ssrc, nullptr);
220220 m_taskRunner->RegisterModule (m_rtpRtcp.get ());
221221
222222 return true ;
@@ -279,9 +279,9 @@ void VideoSendAdapterImpl::onFrame(const Frame& frame)
279279 timeStamp,
280280 timeStamp,
281281 rtc::ArrayView<const uint8_t >(frame.payload , frame.length ),
282- nullptr ,
283282 h,
284- m_rtpRtcp->ExpectedRetransmissionTimeMs ());
283+ m_rtpRtcp->ExpectedRetransmissionTimeMs (),
284+ 0 );
285285 } else if (frame.format == FRAME_FORMAT_VP9) {
286286 h.codec = webrtc::VideoCodecType::kVideoCodecVP9 ;
287287 auto & vp9_header = h.video_type_header .emplace <RTPVideoHeaderVP9>();
@@ -294,9 +294,10 @@ void VideoSendAdapterImpl::onFrame(const Frame& frame)
294294 timeStamp,
295295 timeStamp,
296296 rtc::ArrayView<const uint8_t >(frame.payload , frame.length ),
297- nullptr ,
298297 h,
299- m_rtpRtcp->ExpectedRetransmissionTimeMs ());
298+ m_rtpRtcp->ExpectedRetransmissionTimeMs (),
299+ 0 );
300+
300301 } else if (frame.format == FRAME_FORMAT_H264 || frame.format == FRAME_FORMAT_H265) {
301302 int frame_length = frame.length ;
302303 if (m_enableDump) {
@@ -315,24 +316,10 @@ void VideoSendAdapterImpl::onFrame(const Frame& frame)
315316 int nalu_start_offset = 0 ;
316317 int nalu_end_offset = 0 ;
317318 int sc_len = 0 ;
318- RTPFragmentationHeader frag_info;
319-
320- h.codec = (frame.format == FRAME_FORMAT_H264) ? webrtc::VideoCodecType::kVideoCodecH264 : webrtc::VideoCodecType::kVideoCodecH265 ;
321- while (buffer_length > 0 ) {
322- nalu_found_length = findNALU (buffer_start, buffer_length, &nalu_start_offset, &nalu_end_offset, &sc_len);
323- if (nalu_found_length < 0 ) {
324- /* Error, should never happen */
325- break ;
326- } else {
327- /* SPS, PPS, I, P*/
328- uint16_t last = frag_info.fragmentationVectorSize ;
329- frag_info.VerifyAndAllocateFragmentationHeader (last + 1 );
330- frag_info.fragmentationOffset [last] = nalu_start_offset + (buffer_start - frame.payload );
331- frag_info.fragmentationLength [last] = nalu_found_length;
332- buffer_start += (nalu_start_offset + nalu_found_length);
333- buffer_length -= (nalu_start_offset + nalu_found_length);
334- }
335- }
319+
320+ h.codec = (frame.format == FRAME_FORMAT_H264) ?
321+ webrtc::VideoCodecType::kVideoCodecH264 :
322+ webrtc::VideoCodecType::kVideoCodecH265 ;
336323
337324 boost::shared_lock<boost::shared_mutex> lock (m_rtpRtcpMutex);
338325 if (frame.format == FRAME_FORMAT_H264) {
@@ -343,9 +330,9 @@ void VideoSendAdapterImpl::onFrame(const Frame& frame)
343330 timeStamp,
344331 timeStamp,
345332 rtc::ArrayView<const uint8_t >(frame.payload , frame.length ),
346- &frag_info,
347333 h,
348- m_rtpRtcp->ExpectedRetransmissionTimeMs ());
334+ m_rtpRtcp->ExpectedRetransmissionTimeMs (),
335+ 0 );
349336 } else {
350337 h.video_type_header .emplace <RTPVideoHeaderH265>();
351338 m_senderVideo->SendVideo (
@@ -354,9 +341,9 @@ void VideoSendAdapterImpl::onFrame(const Frame& frame)
354341 timeStamp,
355342 timeStamp,
356343 rtc::ArrayView<const uint8_t >(frame.payload , frame.length ),
357- &frag_info,
358344 h,
359- m_rtpRtcp->ExpectedRetransmissionTimeMs ());
345+ m_rtpRtcp->ExpectedRetransmissionTimeMs (),
346+ 0 );
360347 }
361348 }
362349}
0 commit comments