| 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< |
| 60 MessageLoop* vda_loop, | 60 scoped_refptr<base::MessageLoopProxy>()> MessageLoopFactoryCB; |
| 61 GpuVideoDecoder(const MessageLoopFactoryCB& message_loop_factory_cb, |
| 62 const scoped_refptr<base::MessageLoopProxy>& vda_loop_proxy, |
| 61 const scoped_refptr<Factories>& factories); | 63 const scoped_refptr<Factories>& factories); |
| 62 | 64 |
| 63 // VideoDecoder implementation. | 65 // VideoDecoder implementation. |
| 64 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 66 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
| 65 const PipelineStatusCB& status_cb, | 67 const PipelineStatusCB& status_cb, |
| 66 const StatisticsCB& statistics_cb) OVERRIDE; | 68 const StatisticsCB& statistics_cb) OVERRIDE; |
| 67 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 69 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 68 virtual void Reset(const base::Closure& closure) OVERRIDE; | 70 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 69 virtual void Stop(const base::Closure& closure) OVERRIDE; | 71 virtual void Stop(const base::Closure& closure) OVERRIDE; |
| 70 virtual bool HasAlpha() const OVERRIDE; | 72 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); | 144 SHMBuffer* GetSHM(size_t min_size); |
| 143 | 145 |
| 144 // Return a shared-memory segment to the available pool. | 146 // Return a shared-memory segment to the available pool. |
| 145 void PutSHM(SHMBuffer* shm_buffer); | 147 void PutSHM(SHMBuffer* shm_buffer); |
| 146 | 148 |
| 147 StatisticsCB statistics_cb_; | 149 StatisticsCB statistics_cb_; |
| 148 | 150 |
| 149 // Pointer to the demuxer stream that will feed us compressed buffers. | 151 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 150 scoped_refptr<DemuxerStream> demuxer_stream_; | 152 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 151 | 153 |
| 154 // This is !is_null() iff Initialize() hasn't been called. |
| 155 MessageLoopFactoryCB message_loop_factory_cb_; |
| 156 |
| 152 // MessageLoop on which to fire callbacks and trampoline calls to this class | 157 // MessageLoop on which to fire callbacks and trampoline calls to this class |
| 153 // if they arrive on other loops. | 158 // if they arrive on other loops. |
| 154 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; | 159 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; |
| 155 | 160 |
| 156 // Message loop on which to makes all calls to vda_. (beware this loop may be | 161 // 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 | 162 // paused during the Pause/Flush/Stop dance PipelineImpl::Stop() goes |
| 158 // through). | 163 // through). |
| 159 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; | 164 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; |
| 160 | 165 |
| 161 scoped_refptr<Factories> factories_; | 166 scoped_refptr<Factories> factories_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 221 |
| 217 // Indicates decoding error occurred. | 222 // Indicates decoding error occurred. |
| 218 bool error_occured_; | 223 bool error_occured_; |
| 219 | 224 |
| 220 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 225 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
| 221 }; | 226 }; |
| 222 | 227 |
| 223 } // namespace media | 228 } // namespace media |
| 224 | 229 |
| 225 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 230 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
| OLD | NEW |