Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/rtc_video_decoder_factory_tv.h" | 5 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" | 8 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" |
| 9 #include "media/base/audio_decoder_config.h" | 9 #include "media/base/audio_decoder_config.h" |
| 10 #include "media/base/bind_to_loop.h" | 10 #include "media/base/bind_to_loop.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 if (buffer) | 96 if (buffer) |
| 97 frame_rate_tracker_.Update(1); | 97 frame_rate_tracker_.Update(1); |
| 98 DVLOG(1) << "frame rate received : " << frame_rate_tracker_.units_second(); | 98 DVLOG(1) << "frame rate received : " << frame_rate_tracker_.units_second(); |
| 99 RunReadCallback_Locked(); | 99 RunReadCallback_Locked(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void RTCDemuxerStream::Read(const ReadCB& read_cb) { | 102 void RTCDemuxerStream::Read(const ReadCB& read_cb) { |
| 103 base::AutoLock lock(lock_); | 103 base::AutoLock lock(lock_); |
| 104 DCHECK(read_cb_.is_null()); | 104 DCHECK(read_cb_.is_null()); |
| 105 if (is_destroyed_) { | 105 if (is_destroyed_) { |
| 106 media::BindToLoop(base::MessageLoopProxy::current(), read_cb) | 106 media::BindToCurrentLoop(read_cb).Run(DemuxerStream::kAborted, NULL); |
|
Ami GONE FROM CHROMIUM
2014/01/08 21:37:41
y u no
PostTask(FROM_HERE, MessageLoop::current(),
scherkus (not reviewing)
2014/01/09 01:52:02
done
| |
| 107 .Run(DemuxerStream::kAborted, NULL); | |
| 108 return; | 107 return; |
| 109 } | 108 } |
| 110 read_cb_ = media::BindToLoop(base::MessageLoopProxy::current(), read_cb); | 109 read_cb_ = media::BindToCurrentLoop(read_cb); |
| 111 RunReadCallback_Locked(); | 110 RunReadCallback_Locked(); |
| 112 } | 111 } |
| 113 | 112 |
| 114 void RTCDemuxerStream::Destroy() { | 113 void RTCDemuxerStream::Destroy() { |
| 115 base::AutoLock lock(lock_); | 114 base::AutoLock lock(lock_); |
| 116 DCHECK(!is_destroyed_); | 115 DCHECK(!is_destroyed_); |
| 117 is_destroyed_ = true; | 116 is_destroyed_ = true; |
| 118 if (!read_cb_.is_null()) | 117 if (!read_cb_.is_null()) |
| 119 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kAborted, NULL); | 118 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kAborted, NULL); |
| 120 while (!buffer_queue_.empty()) | 119 while (!buffer_queue_.empty()) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 if (stream_) { | 189 if (stream_) { |
| 191 stream_->Destroy(); | 190 stream_->Destroy(); |
| 192 stream_.reset(); | 191 stream_.reset(); |
| 193 } | 192 } |
| 194 } | 193 } |
| 195 | 194 |
| 196 void RTCVideoDecoderFactoryTv::Initialize(media::DemuxerHost* /*host*/, | 195 void RTCVideoDecoderFactoryTv::Initialize(media::DemuxerHost* /*host*/, |
| 197 const media::PipelineStatusCB& cb, | 196 const media::PipelineStatusCB& cb, |
| 198 bool /*enable_text_tracks*/) { | 197 bool /*enable_text_tracks*/) { |
| 199 base::AutoLock lock(lock_); | 198 base::AutoLock lock(lock_); |
| 200 init_cb_ = media::BindToLoop(base::MessageLoopProxy::current(), cb); | 199 init_cb_ = media::BindToCurrentLoop(cb); |
| 201 if (stream_) | 200 if (stream_) |
| 202 base::ResetAndReturn(&init_cb_).Run(media::PIPELINE_OK); | 201 base::ResetAndReturn(&init_cb_).Run(media::PIPELINE_OK); |
| 203 } | 202 } |
| 204 | 203 |
| 205 void RTCVideoDecoderFactoryTv::Seek(base::TimeDelta time, | 204 void RTCVideoDecoderFactoryTv::Seek(base::TimeDelta time, |
| 206 const media::PipelineStatusCB& status_cb) { | 205 const media::PipelineStatusCB& status_cb) { |
| 207 DCHECK(!status_cb.is_null()); | 206 DCHECK(!status_cb.is_null()); |
| 208 status_cb.Run(media::PIPELINE_OK); | 207 status_cb.Run(media::PIPELINE_OK); |
| 209 } | 208 } |
| 210 | 209 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 237 | 236 |
| 238 void RTCVideoDecoderFactoryTv::QueueBuffer( | 237 void RTCVideoDecoderFactoryTv::QueueBuffer( |
| 239 scoped_refptr<media::DecoderBuffer> buffer, | 238 scoped_refptr<media::DecoderBuffer> buffer, |
| 240 const gfx::Size& new_size) { | 239 const gfx::Size& new_size) { |
| 241 base::AutoLock lock(lock_); | 240 base::AutoLock lock(lock_); |
| 242 DCHECK(stream_); | 241 DCHECK(stream_); |
| 243 stream_->QueueBuffer(buffer, new_size); | 242 stream_->QueueBuffer(buffer, new_size); |
| 244 } | 243 } |
| 245 | 244 |
| 246 } // namespace content | 245 } // namespace content |
| OLD | NEW |