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_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "media/video/video_decode_accelerator.h" | 14 #include "media/video/video_decode_accelerator.h" |
14 #include "ui/gfx/geometry/size_f.h" | 15 #include "ui/gfx/geometry/size_f.h" |
15 #include "ui/gl/gl_context.h" | 16 #include "ui/gl/gl_context.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class CONTENT_EXPORT FakeVideoDecodeAccelerator | 20 class CONTENT_EXPORT FakeVideoDecodeAccelerator |
20 : public media::VideoDecodeAccelerator { | 21 : public media::VideoDecodeAccelerator { |
21 public: | 22 public: |
(...skipping 13 matching lines...) Expand all Loading... |
35 void Reset() override; | 36 void Reset() override; |
36 void Destroy() override; | 37 void Destroy() override; |
37 bool CanDecodeOnIOThread() override; | 38 bool CanDecodeOnIOThread() override; |
38 | 39 |
39 private: | 40 private: |
40 void DoPictureReady(); | 41 void DoPictureReady(); |
41 | 42 |
42 // The message loop that created the class. Used for all callbacks. This | 43 // The message loop that created the class. Used for all callbacks. This |
43 // class expects all calls to this class to be on this message loop (not | 44 // class expects all calls to this class to be on this message loop (not |
44 // checked). | 45 // checked). |
45 const scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_; | 46 const scoped_refptr<base::MessageLoopProxy> child_message_loop_proxy_; |
46 | 47 |
47 Client* client_; | 48 Client* client_; |
48 | 49 |
49 // Make our context current before running any GL entry points. | 50 // Make our context current before running any GL entry points. |
50 base::Callback<bool(void)> make_context_current_; | 51 base::Callback<bool(void)> make_context_current_; |
51 gfx::GLContext* gl_; | 52 gfx::GLContext* gl_; |
52 | 53 |
53 // Output picture size. | 54 // Output picture size. |
54 gfx::Size frame_buffer_size_; | 55 gfx::Size frame_buffer_size_; |
55 | 56 |
56 // Picture buffer ids that are available for putting fake frames in. | 57 // Picture buffer ids that are available for putting fake frames in. |
57 std::queue<int> free_output_buffers_; | 58 std::queue<int> free_output_buffers_; |
58 // BitstreamBuffer ids for buffers that contain new data to decode. | 59 // BitstreamBuffer ids for buffers that contain new data to decode. |
59 std::queue<int> queued_bitstream_ids_; | 60 std::queue<int> queued_bitstream_ids_; |
60 | 61 |
61 bool flushing_; | 62 bool flushing_; |
62 | 63 |
63 // The WeakPtrFactory for |weak_this_|. | 64 // The WeakPtrFactory for |weak_this_|. |
64 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_; | 65 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator); | 67 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator); |
67 }; | 68 }; |
68 | 69 |
69 } // namespace content | 70 } // namespace content |
70 | 71 |
71 #endif // CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ | 72 #endif // CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |