OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_AVDA_STATE_PROVIDER_H_ | 5 #ifndef MEDIA_GPU_AVDA_STATE_PROVIDER_H_ |
6 #define MEDIA_GPU_AVDA_STATE_PROVIDER_H_ | 6 #define MEDIA_GPU_AVDA_STATE_PROVIDER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
10 #include "gpu/command_buffer/service/texture_manager.h" | 10 #include "gpu/command_buffer/service/texture_manager.h" |
11 #include "media/gpu/media_gpu_export.h" | |
12 #include "media/video/video_decode_accelerator.h" | 11 #include "media/video/video_decode_accelerator.h" |
13 | 12 |
14 namespace gl { | 13 namespace gl { |
15 class SurfaceTexture; | 14 class SurfaceTexture; |
16 } | 15 } |
17 | 16 |
18 namespace gpu { | 17 namespace gpu { |
19 namespace gles2 { | 18 namespace gles2 { |
20 class GLES2Decoder; | 19 class GLES2Decoder; |
21 } | 20 } |
22 } | 21 } |
23 | 22 |
24 namespace media { | 23 namespace media { |
25 class VideoCodecBridge; | |
26 } | |
27 | |
28 namespace media { | |
29 | 24 |
30 // Helper class that provides the BackingStrategy with enough state | 25 // Helper class that provides the BackingStrategy with enough state |
31 // to do useful work. | 26 // to do useful work. |
32 class AVDAStateProvider { | 27 class AVDAStateProvider { |
33 public: | 28 public: |
34 virtual ~AVDAStateProvider() {} | |
35 | |
36 // Various handy getters. | 29 // Various handy getters. |
37 virtual const gfx::Size& GetSize() const = 0; | 30 virtual const gfx::Size& GetSize() const = 0; |
38 virtual const base::ThreadChecker& ThreadChecker() const = 0; | 31 virtual const base::ThreadChecker& ThreadChecker() const = 0; |
39 virtual base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const = 0; | 32 virtual base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const = 0; |
40 virtual gpu::gles2::TextureRef* GetTextureForPicture( | 33 virtual gpu::gles2::TextureRef* GetTextureForPicture( |
41 const media::PictureBuffer& picture_buffer) = 0; | 34 const media::PictureBuffer& picture_buffer) = 0; |
42 | 35 |
| 36 // Create a SurfaceTexture and attach a new gl texture to it. |*service_id| |
| 37 // is set to the created texture id. |
| 38 virtual scoped_refptr<gl::SurfaceTexture> CreateAttachedSurfaceTexture( |
| 39 GLuint* service_id) = 0; |
| 40 |
43 // Helper function to report an error condition and stop decoding. | 41 // Helper function to report an error condition and stop decoding. |
44 // This will post NotifyError(), and transition to the error state. | 42 // This will post NotifyError(), and transition to the error state. |
45 // It is meant to be called from the RETURN_ON_FAILURE macro. | 43 // It is meant to be called from the RETURN_ON_FAILURE macro. |
46 virtual void PostError(const ::tracked_objects::Location& from_here, | 44 virtual void PostError(const ::tracked_objects::Location& from_here, |
47 media::VideoDecodeAccelerator::Error error) = 0; | 45 media::VideoDecodeAccelerator::Error error) = 0; |
| 46 |
| 47 protected: |
| 48 ~AVDAStateProvider() = default; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace media | 51 } // namespace media |
51 | 52 |
52 #endif // MEDIA_GPU_AVDA_STATE_PROVIDER_H_ | 53 #endif // MEDIA_GPU_AVDA_STATE_PROVIDER_H_ |
OLD | NEW |