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

Side by Side Diff: media/cast/video_receiver/video_receiver.cc

Issue 229503002: Cast: Make castv2 mirroring performance test run again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 8 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 | « media/cast/video_receiver/video_receiver.h ('k') | media/cast/video_sender/video_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/video_receiver/video_receiver.h" 5 #include "media/cast/video_receiver/video_receiver.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 video_decoder_.reset(new VideoDecoder(cast_environment, video_config)); 63 video_decoder_.reset(new VideoDecoder(cast_environment, video_config));
64 } 64 }
65 decryptor_.Initialize(video_config.aes_key, video_config.aes_iv_mask); 65 decryptor_.Initialize(video_config.aes_key, video_config.aes_iv_mask);
66 rtcp_.SetTargetDelay(target_delay_delta_); 66 rtcp_.SetTargetDelay(target_delay_delta_);
67 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); 67 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_);
68 memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_)); 68 memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_));
69 } 69 }
70 70
71 VideoReceiver::~VideoReceiver() { 71 VideoReceiver::~VideoReceiver() {
72 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 72 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
73
74 // If any callbacks for encoded video frames are queued, flush them out now.
75 // This is critical because some Closures in |frame_request_queue_| may have
76 // Unretained references to |this|.
77 while (!frame_request_queue_.empty()) {
78 frame_request_queue_.front().Run(
79 make_scoped_ptr<transport::EncodedVideoFrame>(NULL), base::TimeTicks());
80 frame_request_queue_.pop_front();
81 }
82
83 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_); 73 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_);
84 } 74 }
85 75
86 void VideoReceiver::InitializeTimers() { 76 void VideoReceiver::InitializeTimers() {
87 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 77 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
88 ScheduleNextRtcpReport(); 78 ScheduleNextRtcpReport();
89 ScheduleNextCastMessage(); 79 ScheduleNextCastMessage();
90 } 80 }
91 81
92 void VideoReceiver::GetRawVideoFrame( 82 void VideoReceiver::GetRawVideoFrame(
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 414 }
425 415
426 void VideoReceiver::SendNextRtcpReport() { 416 void VideoReceiver::SendNextRtcpReport() {
427 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 417 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
428 rtcp_.SendRtcpFromRtpReceiver(NULL, NULL); 418 rtcp_.SendRtcpFromRtpReceiver(NULL, NULL);
429 ScheduleNextRtcpReport(); 419 ScheduleNextRtcpReport();
430 } 420 }
431 421
432 } // namespace cast 422 } // namespace cast
433 } // namespace media 423 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_receiver/video_receiver.h ('k') | media/cast/video_sender/video_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698