OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Allocate & return a shared memory segment. Caller is responsible for | 50 // Allocate & return a shared memory segment. Caller is responsible for |
51 // Close()ing the returned pointer. | 51 // Close()ing the returned pointer. |
52 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 52 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
53 | 53 |
54 protected: | 54 protected: |
55 friend class base::RefCountedThreadSafe<Factories>; | 55 friend class base::RefCountedThreadSafe<Factories>; |
56 virtual ~Factories(); | 56 virtual ~Factories(); |
57 }; | 57 }; |
58 | 58 |
59 GpuVideoDecoder(MessageLoop* message_loop, | 59 typedef base::Callback<scoped_refptr<base::MessageLoopProxy>()> MessageLoopCB; |
60 MessageLoop* vda_loop, | 60 GpuVideoDecoder(const MessageLoopCB& message_loop_cb, |
| 61 const scoped_refptr<base::MessageLoopProxy>& vda_loop_proxy, |
61 const scoped_refptr<Factories>& factories); | 62 const scoped_refptr<Factories>& factories); |
62 | 63 |
63 // VideoDecoder implementation. | 64 // VideoDecoder implementation. |
64 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 65 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
65 const PipelineStatusCB& status_cb, | 66 const PipelineStatusCB& status_cb, |
66 const StatisticsCB& statistics_cb) OVERRIDE; | 67 const StatisticsCB& statistics_cb) OVERRIDE; |
67 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 68 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
68 virtual void Reset(const base::Closure& closure) OVERRIDE; | 69 virtual void Reset(const base::Closure& closure) OVERRIDE; |
69 virtual void Stop(const base::Closure& closure) OVERRIDE; | 70 virtual void Stop(const base::Closure& closure) OVERRIDE; |
70 virtual bool HasAlpha() const OVERRIDE; | 71 virtual bool HasAlpha() const OVERRIDE; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 SHMBuffer* GetSHM(size_t min_size); | 143 SHMBuffer* GetSHM(size_t min_size); |
143 | 144 |
144 // Return a shared-memory segment to the available pool. | 145 // Return a shared-memory segment to the available pool. |
145 void PutSHM(SHMBuffer* shm_buffer); | 146 void PutSHM(SHMBuffer* shm_buffer); |
146 | 147 |
147 StatisticsCB statistics_cb_; | 148 StatisticsCB statistics_cb_; |
148 | 149 |
149 // Pointer to the demuxer stream that will feed us compressed buffers. | 150 // Pointer to the demuxer stream that will feed us compressed buffers. |
150 scoped_refptr<DemuxerStream> demuxer_stream_; | 151 scoped_refptr<DemuxerStream> demuxer_stream_; |
151 | 152 |
| 153 // This is !is_null() iff Initialize() hasn't been called. |
| 154 MessageLoopCB message_loop_factory_cb_; |
| 155 |
152 // MessageLoop on which to fire callbacks and trampoline calls to this class | 156 // MessageLoop on which to fire callbacks and trampoline calls to this class |
153 // if they arrive on other loops. | 157 // if they arrive on other loops. |
154 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; | 158 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; |
155 | 159 |
156 // Message loop on which to makes all calls to vda_. (beware this loop may be | 160 // Message loop on which to makes all calls to vda_. (beware this loop may be |
157 // paused during the Pause/Flush/Stop dance PipelineImpl::Stop() goes | 161 // paused during the Pause/Flush/Stop dance PipelineImpl::Stop() goes |
158 // through). | 162 // through). |
159 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; | 163 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; |
160 | 164 |
161 scoped_refptr<Factories> factories_; | 165 scoped_refptr<Factories> factories_; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 220 |
217 // Indicates decoding error occurred. | 221 // Indicates decoding error occurred. |
218 bool error_occured_; | 222 bool error_occured_; |
219 | 223 |
220 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 224 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
221 }; | 225 }; |
222 | 226 |
223 } // namespace media | 227 } // namespace media |
224 | 228 |
225 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 229 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |