Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: content/common/gpu/media/fake_video_decode_accelerator.h

Issue 1832123002: Revert of Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <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 "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 #include "content/common/gpu/media/gpu_video_decode_accelerator_helpers.h"
17 #include "media/video/video_decode_accelerator.h" 16 #include "media/video/video_decode_accelerator.h"
18 #include "ui/gfx/geometry/size_f.h" 17 #include "ui/gfx/geometry/size_f.h"
19 #include "ui/gl/gl_context.h" 18 #include "ui/gl/gl_context.h"
20 19
21 namespace content { 20 namespace content {
22 21
23 class CONTENT_EXPORT FakeVideoDecodeAccelerator 22 class CONTENT_EXPORT FakeVideoDecodeAccelerator
24 : public media::VideoDecodeAccelerator { 23 : public media::VideoDecodeAccelerator {
25 public: 24 public:
26 FakeVideoDecodeAccelerator( 25 FakeVideoDecodeAccelerator(
27 const gfx::Size& size, 26 gfx::GLContext* gl,
28 const MakeGLContextCurrentCallback& make_context_current_cb); 27 gfx::Size size,
28 const base::Callback<bool(void)>& make_context_current);
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 media::BitstreamBuffer& bitstream_buffer) override;
33 void AssignPictureBuffers( 33 void AssignPictureBuffers(
34 const std::vector<media::PictureBuffer>& buffers) override; 34 const std::vector<media::PictureBuffer>& buffers) override;
35 void ReusePictureBuffer(int32_t picture_buffer_id) override; 35 void ReusePictureBuffer(int32_t picture_buffer_id) override;
36 void Flush() override; 36 void Flush() override;
37 void Reset() override; 37 void Reset() override;
38 void Destroy() override; 38 void Destroy() override;
39 bool TryToSetupDecodeOnSeparateThread( 39 bool CanDecodeOnIOThread() override;
40 const base::WeakPtr<Client>& decode_client,
41 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner)
42 override;
43 40
44 private: 41 private:
45 void DoPictureReady(); 42 void DoPictureReady();
46 43
47 // The message loop that created the class. Used for all callbacks. This 44 // The message loop that created the class. Used for all callbacks. This
48 // class expects all calls to this class to be on this message loop (not 45 // class expects all calls to this class to be on this message loop (not
49 // checked). 46 // checked).
50 const scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_; 47 const scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_;
51 48
52 Client* client_; 49 Client* client_;
53 50
54 // Make our context current before running any GL entry points. 51 // Make our context current before running any GL entry points.
55 MakeGLContextCurrentCallback make_context_current_cb_; 52 base::Callback<bool(void)> make_context_current_;
53 gfx::GLContext* gl_;
56 54
57 // Output picture size. 55 // Output picture size.
58 gfx::Size frame_buffer_size_; 56 gfx::Size frame_buffer_size_;
59 57
60 // Picture buffer ids that are available for putting fake frames in. 58 // Picture buffer ids that are available for putting fake frames in.
61 std::queue<int> free_output_buffers_; 59 std::queue<int> free_output_buffers_;
62 // BitstreamBuffer ids for buffers that contain new data to decode. 60 // BitstreamBuffer ids for buffers that contain new data to decode.
63 std::queue<int> queued_bitstream_ids_; 61 std::queue<int> queued_bitstream_ids_;
64 62
65 bool flushing_; 63 bool flushing_;
66 64
67 // The WeakPtrFactory for |weak_this_|. 65 // The WeakPtrFactory for |weak_this_|.
68 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_; 66 base::WeakPtrFactory<FakeVideoDecodeAccelerator> weak_this_factory_;
69 67
70 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator); 68 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecodeAccelerator);
71 }; 69 };
72 70
73 } // namespace content 71 } // namespace content
74 72
75 #endif // CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_ 73 #endif // CONTENT_COMMON_GPU_MEDIA_FAKE_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698