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 MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "media/gpu/gpu_video_decode_accelerator_helpers.h" | 15 #include "media/gpu/gpu_video_decode_accelerator_helpers.h" |
16 #include "media/gpu/media_gpu_export.h" | 16 #include "media/gpu/media_gpu_export.h" |
17 #include "media/video/video_decode_accelerator.h" | 17 #include "media/video/video_decode_accelerator.h" |
18 #include "ui/gfx/geometry/size_f.h" | 18 #include "ui/gfx/geometry/size_f.h" |
19 #include "ui/gl/gl_context.h" | 19 #include "ui/gl/gl_context.h" |
20 | 20 |
21 namespace media { | 21 namespace media { |
22 | 22 |
23 class MEDIA_GPU_EXPORT FakeVideoDecodeAccelerator | 23 class MEDIA_GPU_EXPORT FakeVideoDecodeAccelerator |
24 : public media::VideoDecodeAccelerator { | 24 : public VideoDecodeAccelerator { |
25 public: | 25 public: |
26 FakeVideoDecodeAccelerator( | 26 FakeVideoDecodeAccelerator( |
27 const gfx::Size& size, | 27 const gfx::Size& size, |
28 const MakeGLContextCurrentCallback& make_context_current_cb); | 28 const MakeGLContextCurrentCallback& make_context_current_cb); |
29 ~FakeVideoDecodeAccelerator() override; | 29 ~FakeVideoDecodeAccelerator() override; |
30 | 30 |
31 bool Initialize(const Config& config, Client* client) override; | 31 bool Initialize(const Config& config, Client* client) override; |
32 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 32 void Decode(const BitstreamBuffer& bitstream_buffer) override; |
33 void AssignPictureBuffers( | 33 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; |
34 const std::vector<media::PictureBuffer>& buffers) override; | |
35 void ReusePictureBuffer(int32_t picture_buffer_id) override; | 34 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
36 void Flush() override; | 35 void Flush() override; |
37 void Reset() override; | 36 void Reset() override; |
38 void Destroy() override; | 37 void Destroy() override; |
39 bool TryToSetupDecodeOnSeparateThread( | 38 bool TryToSetupDecodeOnSeparateThread( |
40 const base::WeakPtr<Client>& decode_client, | 39 const base::WeakPtr<Client>& decode_client, |
41 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) | 40 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) |
42 override; | 41 override; |
43 | 42 |
44 private: | 43 private: |
(...skipping 21 matching lines...) Expand all Loading... |
66 | 65 |
67 // The WeakPtrFactory for |weak_this_|. | 66 // The WeakPtrFactory for |weak_this_|. |
68 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_; | 67 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_; |
69 | 68 |
70 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator); | 69 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator); |
71 }; | 70 }; |
72 | 71 |
73 } // namespace media | 72 } // namespace media |
74 | 73 |
75 #endif // MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 74 #endif // MEDIA_GPU_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |