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 22 matching lines...) Expand all Loading... |
33 // Helper interface for specifying factories needed to instantiate a | 33 // Helper interface for specifying factories needed to instantiate a |
34 // GpuVideoDecoder. | 34 // GpuVideoDecoder. |
35 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { | 35 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { |
36 public: | 36 public: |
37 // Caller owns returned pointer. | 37 // Caller owns returned pointer. |
38 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 38 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
39 VideoDecodeAccelerator::Profile, VideoDecodeAccelerator::Client*) = 0; | 39 VideoDecodeAccelerator::Profile, VideoDecodeAccelerator::Client*) = 0; |
40 | 40 |
41 // Allocate & delete native textures. | 41 // Allocate & delete native textures. |
42 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 42 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
43 std::vector<uint32>* texture_ids) = 0; | 43 std::vector<uint32>* texture_ids, |
| 44 uint32* texture_target) = 0; |
44 virtual void DeleteTexture(uint32 texture_id) = 0; | 45 virtual void DeleteTexture(uint32 texture_id) = 0; |
45 | 46 |
46 // Allocate & return a shared memory segment. Caller is responsible for | 47 // Allocate & return a shared memory segment. Caller is responsible for |
47 // Close()ing the returned pointer. | 48 // Close()ing the returned pointer. |
48 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 49 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
49 | 50 |
50 protected: | 51 protected: |
51 friend class base::RefCountedThreadSafe<Factories>; | 52 friend class base::RefCountedThreadSafe<Factories>; |
52 virtual ~Factories(); | 53 virtual ~Factories(); |
53 }; | 54 }; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Book-keeping variables. | 178 // Book-keeping variables. |
178 struct BufferPair { | 179 struct BufferPair { |
179 BufferPair(SHMBuffer* s, const scoped_refptr<Buffer>& b); | 180 BufferPair(SHMBuffer* s, const scoped_refptr<Buffer>& b); |
180 ~BufferPair(); | 181 ~BufferPair(); |
181 SHMBuffer* shm_buffer; | 182 SHMBuffer* shm_buffer; |
182 scoped_refptr<Buffer> buffer; | 183 scoped_refptr<Buffer> buffer; |
183 }; | 184 }; |
184 std::map<int32, BufferPair> bitstream_buffers_in_decoder_; | 185 std::map<int32, BufferPair> bitstream_buffers_in_decoder_; |
185 std::map<int32, PictureBuffer> picture_buffers_in_decoder_; | 186 std::map<int32, PictureBuffer> picture_buffers_in_decoder_; |
186 | 187 |
| 188 // The texture target used for decoded pictures. |
| 189 uint32 decoder_texture_target_; |
| 190 |
187 struct BufferTimeData { | 191 struct BufferTimeData { |
188 BufferTimeData(int32 bbid, base::TimeDelta ts, base::TimeDelta dur); | 192 BufferTimeData(int32 bbid, base::TimeDelta ts, base::TimeDelta dur); |
189 ~BufferTimeData(); | 193 ~BufferTimeData(); |
190 int32 bitstream_buffer_id; | 194 int32 bitstream_buffer_id; |
191 base::TimeDelta timestamp; | 195 base::TimeDelta timestamp; |
192 base::TimeDelta duration; | 196 base::TimeDelta duration; |
193 }; | 197 }; |
194 std::list<BufferTimeData> input_buffer_time_data_; | 198 std::list<BufferTimeData> input_buffer_time_data_; |
195 | 199 |
196 // picture_buffer_id and the frame wrapping the corresponding Picture, for | 200 // picture_buffer_id and the frame wrapping the corresponding Picture, for |
197 // frames that have been decoded but haven't been requested by a Read() yet. | 201 // frames that have been decoded but haven't been requested by a Read() yet. |
198 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; | 202 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; |
199 int64 next_picture_buffer_id_; | 203 int64 next_picture_buffer_id_; |
200 int64 next_bitstream_buffer_id_; | 204 int64 next_bitstream_buffer_id_; |
201 | 205 |
202 // Indicates PrepareForShutdownHack()'s been called. Makes further calls to | 206 // Indicates PrepareForShutdownHack()'s been called. Makes further calls to |
203 // this class not require the render thread's loop to be processing. | 207 // this class not require the render thread's loop to be processing. |
204 bool shutting_down_; | 208 bool shutting_down_; |
205 | 209 |
206 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 210 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
207 }; | 211 }; |
208 | 212 |
209 } // namespace media | 213 } // namespace media |
210 | 214 |
211 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 215 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |