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 24 matching lines...) Expand all Loading... |
35 // GpuVideoDecoder. | 35 // GpuVideoDecoder. |
36 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { | 36 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { |
37 public: | 37 public: |
38 // Caller owns returned pointer. | 38 // Caller owns returned pointer. |
39 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 39 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
40 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; | 40 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; |
41 | 41 |
42 // Allocate & delete native textures. | 42 // Allocate & delete native textures. |
43 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 43 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
44 std::vector<uint32>* texture_ids, | 44 std::vector<uint32>* texture_ids, |
45 uint32* texture_target) = 0; | 45 uint32 texture_target) = 0; |
46 virtual void DeleteTexture(uint32 texture_id) = 0; | 46 virtual void DeleteTexture(uint32 texture_id) = 0; |
47 | 47 |
48 // Allocate & return a shared memory segment. Caller is responsible for | 48 // Allocate & return a shared memory segment. Caller is responsible for |
49 // Close()ing the returned pointer. | 49 // Close()ing the returned pointer. |
50 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 50 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
51 | 51 |
52 protected: | 52 protected: |
53 friend class base::RefCountedThreadSafe<Factories>; | 53 friend class base::RefCountedThreadSafe<Factories>; |
54 virtual ~Factories(); | 54 virtual ~Factories(); |
55 }; | 55 }; |
56 | 56 |
57 GpuVideoDecoder(MessageLoop* message_loop, | 57 GpuVideoDecoder(MessageLoop* message_loop, |
58 MessageLoop* vda_loop, | 58 MessageLoop* vda_loop, |
59 const scoped_refptr<Factories>& factories); | 59 const scoped_refptr<Factories>& factories); |
60 | 60 |
61 // VideoDecoder implementation. | 61 // VideoDecoder implementation. |
62 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 62 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
63 const PipelineStatusCB& status_cb, | 63 const PipelineStatusCB& status_cb, |
64 const StatisticsCB& statistics_cb) OVERRIDE; | 64 const StatisticsCB& statistics_cb) OVERRIDE; |
65 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 65 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
66 virtual void Reset(const base::Closure& closure) OVERRIDE; | 66 virtual void Reset(const base::Closure& closure) OVERRIDE; |
67 virtual void Stop(const base::Closure& closure) OVERRIDE; | 67 virtual void Stop(const base::Closure& closure) OVERRIDE; |
68 virtual const gfx::Size& natural_size() OVERRIDE; | 68 virtual const gfx::Size& natural_size() OVERRIDE; |
69 virtual bool HasAlpha() const OVERRIDE; | 69 virtual bool HasAlpha() const OVERRIDE; |
70 virtual void PrepareForShutdownHack() OVERRIDE; | 70 virtual void PrepareForShutdownHack() OVERRIDE; |
71 | 71 |
72 // VideoDecodeAccelerator::Client implementation. | 72 // VideoDecodeAccelerator::Client implementation. |
73 virtual void NotifyInitializeDone() OVERRIDE; | 73 virtual void NotifyInitializeDone() OVERRIDE; |
74 virtual void ProvidePictureBuffers(uint32 count, | 74 virtual void ProvidePictureBuffers(uint32 count, |
75 const gfx::Size& size) OVERRIDE; | 75 const gfx::Size& size, |
| 76 uint32 texture_target) OVERRIDE; |
76 virtual void DismissPictureBuffer(int32 id) OVERRIDE; | 77 virtual void DismissPictureBuffer(int32 id) OVERRIDE; |
77 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 78 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
78 virtual void NotifyEndOfBitstreamBuffer(int32 id) OVERRIDE; | 79 virtual void NotifyEndOfBitstreamBuffer(int32 id) OVERRIDE; |
79 virtual void NotifyFlushDone() OVERRIDE; | 80 virtual void NotifyFlushDone() OVERRIDE; |
80 virtual void NotifyResetDone() OVERRIDE; | 81 virtual void NotifyResetDone() OVERRIDE; |
81 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; | 82 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; |
82 | 83 |
83 protected: | 84 protected: |
84 virtual ~GpuVideoDecoder(); | 85 virtual ~GpuVideoDecoder(); |
85 | 86 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 210 |
210 // Indicates decoding error occurred. | 211 // Indicates decoding error occurred. |
211 bool error_occured_; | 212 bool error_occured_; |
212 | 213 |
213 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 214 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
214 }; | 215 }; |
215 | 216 |
216 } // namespace media | 217 } // namespace media |
217 | 218 |
218 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 219 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |