| 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_ = audio_valve; | 51   audio_valve_ = std::move(audio_valve); | 
|  | 52   audio_valve_->OnStarted(); | 
| 52   cast_receiver_->RequestDecodedAudioFrame(on_audio_decoded_cb_); | 53   cast_receiver_->RequestDecodedAudioFrame(on_audio_decoded_cb_); | 
| 53 } | 54 } | 
| 54 | 55 | 
| 55 void CastReceiverSessionDelegate::OnDecodedAudioFrame( | 56 void CastReceiverSessionDelegate::OnDecodedAudioFrame( | 
| 56     std::unique_ptr<media::AudioBus> audio_bus, | 57     std::unique_ptr<media::AudioBus> audio_bus, | 
| 57     const base::TimeTicks& playout_time, | 58     const base::TimeTicks& playout_time, | 
| 58     bool is_continous) { | 59     bool is_continous) { | 
| 59   DCHECK(io_task_runner_->BelongsToCurrentThread()); | 60   DCHECK(io_task_runner_->BelongsToCurrentThread()); | 
| 60   if (!audio_valve_) | 61   if (!audio_valve_) | 
| 61     return; | 62     return; | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 84 | 85 | 
| 85 void CastReceiverSessionDelegate::OnDecodedVideoFrame( | 86 void CastReceiverSessionDelegate::OnDecodedVideoFrame( | 
| 86     const scoped_refptr<media::VideoFrame>& video_frame, | 87     const scoped_refptr<media::VideoFrame>& video_frame, | 
| 87     const base::TimeTicks& playout_time, | 88     const base::TimeTicks& playout_time, | 
| 88     bool is_continous) { | 89     bool is_continous) { | 
| 89   if (frame_callback_.is_null()) | 90   if (frame_callback_.is_null()) | 
| 90     return; | 91     return; | 
| 91   frame_callback_.Run(video_frame, playout_time); | 92   frame_callback_.Run(video_frame, playout_time); | 
| 92   cast_receiver_->RequestDecodedVideoFrame(on_video_decoded_cb_); | 93   cast_receiver_->RequestDecodedVideoFrame(on_video_decoded_cb_); | 
| 93 } | 94 } | 
| OLD | NEW | 
|---|