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

Side by Side Diff: chrome/renderer/media/cast_receiver_session_delegate.cc

Issue 2623443002: Fix getUserMedia so that failure is reported for invalid audio sources. (Closed)
Patch Set: Address comments Created 3 years, 11 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_receiver_audio_valve.cc ('k') | content/renderer/media/external_media_stream_audio_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698