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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 48 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
49 | 49 |
50 protected: | 50 protected: |
51 friend class base::RefCountedThreadSafe<Factories>; | 51 friend class base::RefCountedThreadSafe<Factories>; |
52 virtual ~Factories(); | 52 virtual ~Factories(); |
53 }; | 53 }; |
54 | 54 |
55 GpuVideoDecoder(MessageLoop* message_loop, | 55 GpuVideoDecoder(MessageLoop* message_loop, |
56 MessageLoop* vda_loop, | 56 MessageLoop* vda_loop, |
57 const scoped_refptr<Factories>& factories); | 57 const scoped_refptr<Factories>& factories); |
58 virtual ~GpuVideoDecoder(); | |
59 | 58 |
60 // VideoDecoder implementation. | 59 // VideoDecoder implementation. |
61 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 60 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
62 const PipelineStatusCB& status_cb, | 61 const PipelineStatusCB& status_cb, |
63 const StatisticsCB& statistics_cb) OVERRIDE; | 62 const StatisticsCB& statistics_cb) OVERRIDE; |
64 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 63 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
65 virtual void Reset(const base::Closure& closure) OVERRIDE; | 64 virtual void Reset(const base::Closure& closure) OVERRIDE; |
66 virtual void Stop(const base::Closure& closure) OVERRIDE; | 65 virtual void Stop(const base::Closure& closure) OVERRIDE; |
67 virtual const gfx::Size& natural_size() OVERRIDE; | 66 virtual const gfx::Size& natural_size() OVERRIDE; |
68 virtual bool HasAlpha() const OVERRIDE; | 67 virtual bool HasAlpha() const OVERRIDE; |
69 virtual void PrepareForShutdownHack() OVERRIDE; | 68 virtual void PrepareForShutdownHack() OVERRIDE; |
70 | 69 |
71 // VideoDecodeAccelerator::Client implementation. | 70 // VideoDecodeAccelerator::Client implementation. |
72 virtual void NotifyInitializeDone() OVERRIDE; | 71 virtual void NotifyInitializeDone() OVERRIDE; |
73 virtual void ProvidePictureBuffers(uint32 count, | 72 virtual void ProvidePictureBuffers(uint32 count, |
74 const gfx::Size& size) OVERRIDE; | 73 const gfx::Size& size) OVERRIDE; |
75 virtual void DismissPictureBuffer(int32 id) OVERRIDE; | 74 virtual void DismissPictureBuffer(int32 id) OVERRIDE; |
76 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 75 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
77 virtual void NotifyEndOfBitstreamBuffer(int32 id) OVERRIDE; | 76 virtual void NotifyEndOfBitstreamBuffer(int32 id) OVERRIDE; |
78 virtual void NotifyFlushDone() OVERRIDE; | 77 virtual void NotifyFlushDone() OVERRIDE; |
79 virtual void NotifyResetDone() OVERRIDE; | 78 virtual void NotifyResetDone() OVERRIDE; |
80 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; | 79 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; |
81 | 80 |
| 81 protected: |
| 82 virtual ~GpuVideoDecoder(); |
| 83 |
82 private: | 84 private: |
83 enum State { | 85 enum State { |
84 kNormal, | 86 kNormal, |
85 // Avoid the use of "flush" in these enums because the term is overloaded: | 87 // Avoid the use of "flush" in these enums because the term is overloaded: |
86 // Filter::Flush() means drop pending data on the floor, but | 88 // Filter::Flush() means drop pending data on the floor, but |
87 // VideoDecodeAccelerator::Flush() means drain pending data (Filter::Flush() | 89 // VideoDecodeAccelerator::Flush() means drain pending data (Filter::Flush() |
88 // actually corresponds to VideoDecodeAccelerator::Reset(), confusingly | 90 // actually corresponds to VideoDecodeAccelerator::Reset(), confusingly |
89 // enough). | 91 // enough). |
90 kDrainingDecoder, | 92 kDrainingDecoder, |
91 kDecoderDrained, | 93 kDecoderDrained, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 207 |
206 // Indicates decoding error occurred. | 208 // Indicates decoding error occurred. |
207 bool error_occured_; | 209 bool error_occured_; |
208 | 210 |
209 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 211 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
210 }; | 212 }; |
211 | 213 |
212 } // namespace media | 214 } // namespace media |
213 | 215 |
214 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 216 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |