Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Side by Side Diff: webrtc/video/video_receive_stream.cc

Issue 1924793002: Remove webrtc/stream.h and unutilized inheritance. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: re-rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | webrtc/video/video_send_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 vie_channel_.RegisterPreRenderCallback(nullptr); 315 vie_channel_.RegisterPreRenderCallback(nullptr);
316 316
317 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); 317 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver());
318 rtp_rtcp_->SetREMBStatus(false); 318 rtp_rtcp_->SetREMBStatus(false);
319 remb_->RemoveReceiveChannel(rtp_rtcp_); 319 remb_->RemoveReceiveChannel(rtp_rtcp_);
320 320
321 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_)) 321 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_))
322 ->RemoveStream(rtp_stream_receiver_.GetRemoteSsrc()); 322 ->RemoveStream(rtp_stream_receiver_.GetRemoteSsrc());
323 } 323 }
324 324
325 void VideoReceiveStream::SignalNetworkState(NetworkState state) {
326 rtp_rtcp_->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode
327 : RtcpMode::kOff);
328 }
329
330
331 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) {
332 return rtp_stream_receiver_.DeliverRtcp(packet, length);
333 }
334
335 bool VideoReceiveStream::DeliverRtp(const uint8_t* packet,
336 size_t length,
337 const PacketTime& packet_time) {
338 return rtp_stream_receiver_.DeliverRtp(packet, length, packet_time);
339 }
340
325 void VideoReceiveStream::Start() { 341 void VideoReceiveStream::Start() {
326 if (decode_thread_.IsRunning()) 342 if (decode_thread_.IsRunning())
327 return; 343 return;
328 transport_adapter_.Enable(); 344 transport_adapter_.Enable();
329 incoming_video_stream_.Start(); 345 incoming_video_stream_.Start();
330 // Start the decode thread 346 // Start the decode thread
331 decode_thread_.Start(); 347 decode_thread_.Start();
332 decode_thread_.SetPriority(rtc::kHighestPriority); 348 decode_thread_.SetPriority(rtc::kHighestPriority);
333 rtp_stream_receiver_.StartReceive(); 349 rtp_stream_receiver_.StartReceive();
334 } 350 }
(...skipping 16 matching lines...) Expand all
351 return; 367 return;
352 } 368 }
353 vie_sync_.ConfigureSync(-1, nullptr, rtp_rtcp_, 369 vie_sync_.ConfigureSync(-1, nullptr, rtp_rtcp_,
354 rtp_stream_receiver_.GetRtpReceiver()); 370 rtp_stream_receiver_.GetRtpReceiver());
355 } 371 }
356 372
357 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { 373 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const {
358 return stats_proxy_.GetStats(); 374 return stats_proxy_.GetStats();
359 } 375 }
360 376
361 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) {
362 return rtp_stream_receiver_.DeliverRtcp(packet, length);
363 }
364
365 bool VideoReceiveStream::DeliverRtp(const uint8_t* packet,
366 size_t length,
367 const PacketTime& packet_time) {
368 return rtp_stream_receiver_.DeliverRtp(packet, length, packet_time);
369 }
370
371 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { 377 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) {
372 stats_proxy_.OnDecodedFrame(); 378 stats_proxy_.OnDecodedFrame();
373 379
374 // Post processing is not supported if the frame is backed by a texture. 380 // Post processing is not supported if the frame is backed by a texture.
375 if (!video_frame->video_frame_buffer()->native_handle()) { 381 if (!video_frame->video_frame_buffer()->native_handle()) {
376 if (config_.pre_render_callback) 382 if (config_.pre_render_callback)
377 config_.pre_render_callback->FrameCallback(video_frame); 383 config_.pre_render_callback->FrameCallback(video_frame);
378 } 384 }
379 } 385 }
380 386
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 420 }
415 if (ivf_writer_.get()) { 421 if (ivf_writer_.get()) {
416 bool ok = ivf_writer_->WriteFrame(encoded_image); 422 bool ok = ivf_writer_->WriteFrame(encoded_image);
417 RTC_DCHECK(ok); 423 RTC_DCHECK(ok);
418 } 424 }
419 } 425 }
420 426
421 return 0; 427 return 0;
422 } 428 }
423 429
424 void VideoReceiveStream::SignalNetworkState(NetworkState state) {
425 rtp_rtcp_->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode
426 : RtcpMode::kOff);
427 }
428
429 bool VideoReceiveStream::DecodeThreadFunction(void* ptr) { 430 bool VideoReceiveStream::DecodeThreadFunction(void* ptr) {
430 static_cast<VideoReceiveStream*>(ptr)->Decode(); 431 static_cast<VideoReceiveStream*>(ptr)->Decode();
431 return true; 432 return true;
432 } 433 }
433 434
434 void VideoReceiveStream::Decode() { 435 void VideoReceiveStream::Decode() {
435 static const int kMaxDecodeWaitTimeMs = 50; 436 static const int kMaxDecodeWaitTimeMs = 50;
436 video_receiver_.Decode(kMaxDecodeWaitTimeMs); 437 video_receiver_.Decode(kMaxDecodeWaitTimeMs);
437 } 438 }
438 439
439 void VideoReceiveStream::SendNack( 440 void VideoReceiveStream::SendNack(
440 const std::vector<uint16_t>& sequence_numbers) { 441 const std::vector<uint16_t>& sequence_numbers) {
441 rtp_rtcp_->SendNack(sequence_numbers); 442 rtp_rtcp_->SendNack(sequence_numbers);
442 } 443 }
443 444
444 void VideoReceiveStream::RequestKeyFrame() { 445 void VideoReceiveStream::RequestKeyFrame() {
445 rtp_rtcp_->RequestKeyFrame(); 446 rtp_rtcp_->RequestKeyFrame();
446 } 447 }
447 448
448 } // namespace internal 449 } // namespace internal
449 } // namespace webrtc 450 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | webrtc/video/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698