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