OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test/utility/in_process_receiver.h" | 5 #include "media/cast/test/utility/in_process_receiver.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (audio_frame.get()) | 100 if (audio_frame.get()) |
101 OnAudioFrame(audio_frame.Pass(), playout_time, is_continuous); | 101 OnAudioFrame(audio_frame.Pass(), playout_time, is_continuous); |
102 PullNextAudioFrame(); | 102 PullNextAudioFrame(); |
103 } | 103 } |
104 | 104 |
105 void InProcessReceiver::GotVideoFrame( | 105 void InProcessReceiver::GotVideoFrame( |
106 const scoped_refptr<VideoFrame>& video_frame, | 106 const scoped_refptr<VideoFrame>& video_frame, |
107 const base::TimeTicks& playout_time, | 107 const base::TimeTicks& playout_time, |
108 bool is_continuous) { | 108 bool is_continuous) { |
109 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 109 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
110 if (video_frame) | 110 if (video_frame.get()) |
111 OnVideoFrame(video_frame, playout_time, is_continuous); | 111 OnVideoFrame(video_frame, playout_time, is_continuous); |
112 PullNextVideoFrame(); | 112 PullNextVideoFrame(); |
113 } | 113 } |
114 | 114 |
115 void InProcessReceiver::PullNextAudioFrame() { | 115 void InProcessReceiver::PullNextAudioFrame() { |
116 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 116 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
117 cast_receiver_->RequestDecodedAudioFrame( | 117 cast_receiver_->RequestDecodedAudioFrame( |
118 base::Bind(&InProcessReceiver::GotAudioFrame, | 118 base::Bind(&InProcessReceiver::GotAudioFrame, |
119 weak_factory_.GetWeakPtr())); | 119 weak_factory_.GetWeakPtr())); |
120 } | 120 } |
121 | 121 |
122 void InProcessReceiver::PullNextVideoFrame() { | 122 void InProcessReceiver::PullNextVideoFrame() { |
123 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 123 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
124 cast_receiver_->RequestDecodedVideoFrame(base::Bind( | 124 cast_receiver_->RequestDecodedVideoFrame(base::Bind( |
125 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); | 125 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); |
126 } | 126 } |
127 | 127 |
128 } // namespace cast | 128 } // namespace cast |
129 } // namespace media | 129 } // namespace media |
OLD | NEW |