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 "media/base/callback.h" | 8 #include "media/base/callback.h" |
9 #include "media/base/factory.h" | 9 #include "media/base/factory.h" |
10 #include "media/base/filter_host.h" | 10 #include "media/base/filter_host.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // TODO(hclam): Make sure OmxVideoDecodeEngine is stopped. | 50 // TODO(hclam): Make sure OmxVideoDecodeEngine is stopped. |
51 } | 51 } |
52 | 52 |
53 void OmxVideoDecoder::Initialize(DemuxerStream* demuxer_stream, | 53 void OmxVideoDecoder::Initialize(DemuxerStream* demuxer_stream, |
54 FilterCallback* callback) { | 54 FilterCallback* callback) { |
55 if (MessageLoop::current() != message_loop()) { | 55 if (MessageLoop::current() != message_loop()) { |
56 message_loop()->PostTask( | 56 message_loop()->PostTask( |
57 FROM_HERE, | 57 FROM_HERE, |
58 NewRunnableMethod(this, | 58 NewRunnableMethod(this, |
59 &OmxVideoDecoder::Initialize, | 59 &OmxVideoDecoder::Initialize, |
60 make_scoped_refptr(demuxer_stream), | 60 demuxer_stream, |
61 callback)); | 61 callback)); |
62 return; | 62 return; |
63 } | 63 } |
64 | 64 |
65 DCHECK_EQ(message_loop(), MessageLoop::current()); | 65 DCHECK_EQ(message_loop(), MessageLoop::current()); |
66 DCHECK(!demuxer_stream_); | 66 DCHECK(!demuxer_stream_); |
67 DCHECK(!initialize_callback_.get()); | 67 DCHECK(!initialize_callback_.get()); |
68 | 68 |
69 initialize_callback_.reset(callback); | 69 initialize_callback_.reset(callback); |
70 demuxer_stream_ = demuxer_stream; | 70 demuxer_stream_ = demuxer_stream; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 FROM_HERE, | 248 FROM_HERE, |
249 NewRunnableMethod(omx_engine_.get(), | 249 NewRunnableMethod(omx_engine_.get(), |
250 &VideoDecodeEngine::ConsumeVideoSample, ref_buffer)); | 250 &VideoDecodeEngine::ConsumeVideoSample, ref_buffer)); |
251 } | 251 } |
252 | 252 |
253 } // namespace media | 253 } // namespace media |
254 | 254 |
255 // Disable refcounting for the decode engine because it only lives on the | 255 // Disable refcounting for the decode engine because it only lives on the |
256 // video decoder thread. | 256 // video decoder thread. |
257 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoDecodeEngine); | 257 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoDecodeEngine); |
OLD | NEW |