| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/renderer/media/cast_receiver_session_delegate.h" | 5 #include "chrome/renderer/media/cast_receiver_session_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 void CastReceiverSessionDelegate::ReceivePacket( | 43 void CastReceiverSessionDelegate::ReceivePacket( |
| 44 std::unique_ptr<media::cast::Packet> packet) { | 44 std::unique_ptr<media::cast::Packet> packet) { |
| 45 cast_receiver_->ReceivePacket(std::move(packet)); | 45 cast_receiver_->ReceivePacket(std::move(packet)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void CastReceiverSessionDelegate::StartAudio( | 48 void CastReceiverSessionDelegate::StartAudio( |
| 49 scoped_refptr<CastReceiverAudioValve> audio_valve) { | 49 scoped_refptr<CastReceiverAudioValve> audio_valve) { |
| 50 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 50 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 51 audio_valve_ = std::move(audio_valve); | 51 audio_valve_ = audio_valve; |
| 52 audio_valve_->OnStarted(); | |
| 53 cast_receiver_->RequestDecodedAudioFrame(on_audio_decoded_cb_); | 52 cast_receiver_->RequestDecodedAudioFrame(on_audio_decoded_cb_); |
| 54 } | 53 } |
| 55 | 54 |
| 56 void CastReceiverSessionDelegate::OnDecodedAudioFrame( | 55 void CastReceiverSessionDelegate::OnDecodedAudioFrame( |
| 57 std::unique_ptr<media::AudioBus> audio_bus, | 56 std::unique_ptr<media::AudioBus> audio_bus, |
| 58 const base::TimeTicks& playout_time, | 57 const base::TimeTicks& playout_time, |
| 59 bool is_continous) { | 58 bool is_continous) { |
| 60 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 59 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 61 if (!audio_valve_) | 60 if (!audio_valve_) |
| 62 return; | 61 return; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 85 | 84 |
| 86 void CastReceiverSessionDelegate::OnDecodedVideoFrame( | 85 void CastReceiverSessionDelegate::OnDecodedVideoFrame( |
| 87 const scoped_refptr<media::VideoFrame>& video_frame, | 86 const scoped_refptr<media::VideoFrame>& video_frame, |
| 88 const base::TimeTicks& playout_time, | 87 const base::TimeTicks& playout_time, |
| 89 bool is_continous) { | 88 bool is_continous) { |
| 90 if (frame_callback_.is_null()) | 89 if (frame_callback_.is_null()) |
| 91 return; | 90 return; |
| 92 frame_callback_.Run(video_frame, playout_time); | 91 frame_callback_.Run(video_frame, playout_time); |
| 93 cast_receiver_->RequestDecodedVideoFrame(on_video_decoded_cb_); | 92 cast_receiver_->RequestDecodedVideoFrame(on_video_decoded_cb_); |
| 94 } | 93 } |
| OLD | NEW |