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

Side by Side Diff: media/remoting/courier_renderer.cc

Issue 2669033004: Media Remoting: Don't report remote renderer init error to pipeline. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/remoting/courier_renderer.h" 5 #include "media/remoting/courier_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 void CourierRenderer::OnDataPipeCreated( 313 void CourierRenderer::OnDataPipeCreated(
314 mojom::RemotingDataStreamSenderPtrInfo audio, 314 mojom::RemotingDataStreamSenderPtrInfo audio,
315 mojom::RemotingDataStreamSenderPtrInfo video, 315 mojom::RemotingDataStreamSenderPtrInfo video,
316 mojo::ScopedDataPipeProducerHandle audio_handle, 316 mojo::ScopedDataPipeProducerHandle audio_handle,
317 mojo::ScopedDataPipeProducerHandle video_handle, 317 mojo::ScopedDataPipeProducerHandle video_handle,
318 int audio_rpc_handle, 318 int audio_rpc_handle,
319 int video_rpc_handle) { 319 int video_rpc_handle) {
320 VLOG(2) << __func__; 320 VLOG(2) << __func__;
321 DCHECK(media_task_runner_->BelongsToCurrentThread()); 321 DCHECK(media_task_runner_->BelongsToCurrentThread());
322 DCHECK(!init_workflow_done_callback_.is_null()); 322 DCHECK(!init_workflow_done_callback_.is_null());
miu 2017/02/02 20:50:16 Could this DCHECK() trip? Probably not, but maybe
xjz 2017/02/02 22:07:11 Done. I couldn't think of a case that this DCHECK
323 323
324 if (state_ == STATE_ERROR) 324 if (state_ == STATE_ERROR)
325 return; // Abort because something went wrong in the meantime. 325 return; // Abort because something went wrong in the meantime.
326 DCHECK_EQ(state_, STATE_CREATE_PIPE); 326 DCHECK_EQ(state_, STATE_CREATE_PIPE);
327 327
328 // Create audio demuxer stream adapter if audio is available. 328 // Create audio demuxer stream adapter if audio is available.
329 DemuxerStream* audio_demuxer_stream = 329 DemuxerStream* audio_demuxer_stream =
330 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); 330 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO);
331 if (audio_demuxer_stream && audio.is_valid() && audio_handle.is_valid() && 331 if (audio_demuxer_stream && audio.is_valid() && audio_handle.is_valid() &&
332 audio_rpc_handle != RpcBroker::kInvalidHandle) { 332 audio_rpc_handle != RpcBroker::kInvalidHandle) {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // controller will cause this renderer to shut down shortly. 666 // controller will cause this renderer to shut down shortly.
667 if (state_ != STATE_ERROR) { 667 if (state_ != STATE_ERROR) {
668 state_ = STATE_ERROR; 668 state_ = STATE_ERROR;
669 main_task_runner_->PostTask( 669 main_task_runner_->PostTask(
670 FROM_HERE, base::Bind(&RendererController::OnRendererFatalError, 670 FROM_HERE, base::Bind(&RendererController::OnRendererFatalError,
671 controller_, stop_trigger)); 671 controller_, stop_trigger));
672 } 672 }
673 673
674 data_flow_poll_timer_.Stop(); 674 data_flow_poll_timer_.Stop();
675 675
676 // This renderer will be shut down shortly. To prevent breaking the pipeline,
677 // just run the callback without reporting error.
676 if (!init_workflow_done_callback_.is_null()) { 678 if (!init_workflow_done_callback_.is_null()) {
677 base::ResetAndReturn(&init_workflow_done_callback_) 679 base::ResetAndReturn(&init_workflow_done_callback_).Run(PIPELINE_OK);
678 .Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
679 return; 680 return;
680 } 681 }
681 682
682 if (!flush_cb_.is_null()) 683 if (!flush_cb_.is_null())
683 base::ResetAndReturn(&flush_cb_).Run(); 684 base::ResetAndReturn(&flush_cb_).Run();
684 } 685 }
685 686
686 // static 687 // static
687 void CourierRenderer::RequestUpdateInterstitialOnMainThread( 688 void CourierRenderer::RequestUpdateInterstitialOnMainThread(
688 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, 689 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 kBytesPerKilobit; 843 kBytesPerKilobit;
843 DCHECK_GE(kilobits_per_second, 0); 844 DCHECK_GE(kilobits_per_second, 0);
844 const base::CheckedNumeric<int> checked_kbps = kilobits_per_second; 845 const base::CheckedNumeric<int> checked_kbps = kilobits_per_second;
845 metrics_recorder_.OnVideoRateEstimate( 846 metrics_recorder_.OnVideoRateEstimate(
846 checked_kbps.ValueOrDefault(std::numeric_limits<int>::max())); 847 checked_kbps.ValueOrDefault(std::numeric_limits<int>::max()));
847 } 848 }
848 } 849 }
849 850
850 } // namespace remoting 851 } // namespace remoting
851 } // namespace media 852 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698