diff options
author | hclam <hclam@chromium.org> | 2014-09-10 13:29:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-10 20:38:46 +0000 |
commit | 42d3637eb8a7a82ac5a3183272224b6c2b5f2249 (patch) | |
tree | 6e29ef15ca86a6cd09ea35e5ecbaff759dd76380 /media/cast/cast_sender_impl.cc | |
parent | 660e22c9b046890cb64947d0942469ea3b5003e2 (diff) | |
download | chromium_src-42d3637eb8a7a82ac5a3183272224b6c2b5f2249.zip chromium_src-42d3637eb8a7a82ac5a3183272224b6c2b5f2249.tar.gz chromium_src-42d3637eb8a7a82ac5a3183272224b6c2b5f2249.tar.bz2 |
Cast: Flow hw encoder initialization error to extensions API
cast.streaming API will be notified if there is a hardware
initialization error. This way extension can decide whether to restart
with a different codec or just fail.
Also fixed a small issue that Framer is printing too many messages.
BUG=402182
Review URL: https://codereview.chromium.org/555563003
Cr-Commit-Position: refs/heads/master@{#294216}
Diffstat (limited to 'media/cast/cast_sender_impl.cc')
-rw-r--r-- | media/cast/cast_sender_impl.cc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/media/cast/cast_sender_impl.cc b/media/cast/cast_sender_impl.cc index f617ef4..a8d63fe 100644 --- a/media/cast/cast_sender_impl.cc +++ b/media/cast/cast_sender_impl.cc @@ -105,7 +105,6 @@ void CastSenderImpl::InitializeAudio( const CastInitializationStatus status = audio_sender_->InitializationResult(); if (status == STATUS_AUDIO_INITIALIZED) { - ssrc_of_audio_sender_ = audio_config.incoming_feedback_ssrc; audio_frame_input_ = new LocalAudioFrameInput(cast_environment_, audio_sender_->AsWeakPtr()); } @@ -127,19 +126,14 @@ void CastSenderImpl::InitializeVideo( VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; - video_sender_.reset(new VideoSender(cast_environment_, - video_config, - create_vea_cb, - create_video_encode_mem_cb, - transport_sender_)); - - const CastInitializationStatus status = video_sender_->InitializationResult(); - if (status == STATUS_VIDEO_INITIALIZED) { - ssrc_of_video_sender_ = video_config.incoming_feedback_ssrc; - video_frame_input_ = - new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); - } - cast_initialization_cb.Run(status); + video_sender_.reset(new VideoSender( + cast_environment_, + video_config, + base::Bind(&CastSenderImpl::OnVideoInitialized, + weak_factory_.GetWeakPtr(), cast_initialization_cb), + create_vea_cb, + create_video_encode_mem_cb, + transport_sender_)); if (audio_sender_) { DCHECK(audio_sender_->GetTargetPlayoutDelay() == video_sender_->GetTargetPlayoutDelay()); @@ -170,5 +164,14 @@ void CastSenderImpl::SetTargetPlayoutDelay( } } +void CastSenderImpl::OnVideoInitialized( + const CastInitializationCallback& initialization_cb, + media::cast::CastInitializationStatus result) { + DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); + video_frame_input_ = + new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); + initialization_cb.Run(result); +} + } // namespace cast } // namespace media |