| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/filters/omx_video_decoder.h" | 5 #include "media/filters/omx_video_decoder.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "media/base/callback.h" | 9 #include "media/base/callback.h" |
| 10 #include "media/base/filter_host.h" | 10 #include "media/base/filter_host.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 FROM_HERE, | 213 FROM_HERE, |
| 214 NewRunnableMethod(decode_engine_.get(), | 214 NewRunnableMethod(decode_engine_.get(), |
| 215 &VideoDecodeEngine::ProduceVideoFrame, frame)); | 215 &VideoDecodeEngine::ProduceVideoFrame, frame)); |
| 216 } | 216 } |
| 217 | 217 |
| 218 bool OmxVideoDecoder::ProvidesBuffer() { | 218 bool OmxVideoDecoder::ProvidesBuffer() { |
| 219 DCHECK(info_.success); | 219 DCHECK(info_.success); |
| 220 return info_.provides_buffers; | 220 return info_.provides_buffers; |
| 221 } | 221 } |
| 222 | 222 |
| 223 const MediaFormat& OmxVideoDecoder::media_format() { |
| 224 return media_format_; |
| 225 } |
| 226 |
| 223 void OmxVideoDecoder::DemuxCompleteTask(Buffer* buffer) { | 227 void OmxVideoDecoder::DemuxCompleteTask(Buffer* buffer) { |
| 224 // We simply delicate the buffer to the right message loop. | 228 // We simply delicate the buffer to the right message loop. |
| 225 scoped_refptr<Buffer> ref_buffer = buffer; | 229 scoped_refptr<Buffer> ref_buffer = buffer; |
| 226 DCHECK(decode_engine_.get()); | 230 DCHECK(decode_engine_.get()); |
| 227 message_loop()->PostTask( | 231 message_loop()->PostTask( |
| 228 FROM_HERE, | 232 FROM_HERE, |
| 229 NewRunnableMethod(decode_engine_.get(), | 233 NewRunnableMethod(decode_engine_.get(), |
| 230 &VideoDecodeEngine::ConsumeVideoSample, ref_buffer)); | 234 &VideoDecodeEngine::ConsumeVideoSample, ref_buffer)); |
| 231 } | 235 } |
| 232 | 236 |
| 233 } // namespace media | 237 } // namespace media |
| 234 | 238 |
| 235 // Disable refcounting for the decode engine because it only lives on the | 239 // Disable refcounting for the decode engine because it only lives on the |
| 236 // video decoder thread. | 240 // video decoder thread. |
| 237 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoDecodeEngine); | 241 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoDecodeEngine); |
| OLD | NEW |