OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
6 #define CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ | 6 #define CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 class PepperVideoDecoderHost; | 44 class PepperVideoDecoderHost; |
45 | 45 |
46 // This class is a shim to wrap a media::VideoDecoder so that it can be used | 46 // This class is a shim to wrap a media::VideoDecoder so that it can be used |
47 // by PepperVideoDecoderHost in place of a media::VideoDecodeAccelerator. | 47 // by PepperVideoDecoderHost in place of a media::VideoDecodeAccelerator. |
48 // This class should be constructed, used, and destructed on the main (render) | 48 // This class should be constructed, used, and destructed on the main (render) |
49 // thread. | 49 // thread. |
50 class VideoDecoderShim : public media::VideoDecodeAccelerator { | 50 class VideoDecoderShim : public media::VideoDecodeAccelerator { |
51 public: | 51 public: |
52 explicit VideoDecoderShim(PepperVideoDecoderHost* host); | 52 explicit VideoDecoderShim(PepperVideoDecoderHost* host); |
53 virtual ~VideoDecoderShim(); | 53 ~VideoDecoderShim() override; |
54 | 54 |
55 // media::VideoDecodeAccelerator implementation. | 55 // media::VideoDecodeAccelerator implementation. |
56 virtual bool Initialize( | 56 bool Initialize(media::VideoCodecProfile profile, |
57 media::VideoCodecProfile profile, | 57 media::VideoDecodeAccelerator::Client* client) override; |
58 media::VideoDecodeAccelerator::Client* client) override; | 58 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
59 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 59 void AssignPictureBuffers( |
60 virtual void AssignPictureBuffers( | |
61 const std::vector<media::PictureBuffer>& buffers) override; | 60 const std::vector<media::PictureBuffer>& buffers) override; |
62 virtual void ReusePictureBuffer(int32 picture_buffer_id) override; | 61 void ReusePictureBuffer(int32 picture_buffer_id) override; |
63 virtual void Flush() override; | 62 void Flush() override; |
64 virtual void Reset() override; | 63 void Reset() override; |
65 virtual void Destroy() override; | 64 void Destroy() override; |
66 | 65 |
67 private: | 66 private: |
68 enum State { | 67 enum State { |
69 UNINITIALIZED, | 68 UNINITIALIZED, |
70 DECODING, | 69 DECODING, |
71 FLUSHING, | 70 FLUSHING, |
72 RESETTING, | 71 RESETTING, |
73 }; | 72 }; |
74 | 73 |
75 struct PendingDecode; | 74 struct PendingDecode; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 uint32_t num_pending_decodes_; | 122 uint32_t num_pending_decodes_; |
124 | 123 |
125 base::WeakPtrFactory<VideoDecoderShim> weak_ptr_factory_; | 124 base::WeakPtrFactory<VideoDecoderShim> weak_ptr_factory_; |
126 | 125 |
127 DISALLOW_COPY_AND_ASSIGN(VideoDecoderShim); | 126 DISALLOW_COPY_AND_ASSIGN(VideoDecoderShim); |
128 }; | 127 }; |
129 | 128 |
130 } // namespace content | 129 } // namespace content |
131 | 130 |
132 #endif // CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ | 131 #endif // CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
OLD | NEW |