Index: media/cast/video_receiver/video_receiver.cc |
diff --git a/media/cast/video_receiver/video_receiver.cc b/media/cast/video_receiver/video_receiver.cc |
index c637d7a97c6d23fb1eac4f971f1c9de55610cee5..261c4ca78ddf5853ca7e147915de8e3a8a643824 100644 |
--- a/media/cast/video_receiver/video_receiver.cc |
+++ b/media/cast/video_receiver/video_receiver.cc |
@@ -124,6 +124,7 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment, |
max_unacked_frames)); |
if (!video_config.use_external_decoder) { |
video_decoder_.reset(new VideoDecoder(video_config, cast_environment)); |
+ InitDecoder(); |
} |
rtcp_.reset( |
@@ -147,6 +148,17 @@ void VideoReceiver::InitializeTimers() { |
ScheduleNextCastMessage(); |
} |
+void VideoReceiver::InitDecoder() { |
pwestin
2013/11/21 19:10:42
instead of having this code here; why not post the
mikhal
2013/11/21 19:27:00
Had th same thought, but wasn't sure what's better
|
+ cast_environment_->PostTask(CastEnvironment::VIDEO_DECODER, FROM_HERE, |
+ base::Bind(&VideoReceiver::InitDecoderThread, |
+ weak_factory_.GetWeakPtr())); |
+} |
+ |
+void VideoReceiver::InitDecoderThread() { |
+ DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::VIDEO_DECODER)); |
+ video_decoder_->InitDecoder(); |
+} |
+ |
void VideoReceiver::GetRawVideoFrame( |
const VideoFrameDecodedCallback& callback) { |
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |