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 CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ | 5 #ifndef MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ | 6 #define MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/common/content_export.h" | 11 #include "media/gpu/android_video_decode_accelerator.h" |
12 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 12 #include "media/gpu/media_gpu_export.h" |
13 | 13 |
14 namespace gl { | 14 namespace gl { |
15 class GLImage; | 15 class GLImage; |
16 } | 16 } |
17 | 17 |
18 namespace gpu { | 18 namespace gpu { |
19 namespace gles2 { | 19 namespace gles2 { |
20 class GLStreamTextureImage; | 20 class GLStreamTextureImage; |
21 class TextureRef; | 21 class TextureRef; |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace media { |
26 | 26 |
27 class AVDACodecImage; | 27 class AVDACodecImage; |
28 class AVDASharedState; | 28 class AVDASharedState; |
29 | 29 |
30 // A BackingStrategy implementation that defers releasing codec buffers until | 30 // A BackingStrategy implementation that defers releasing codec buffers until |
31 // a PictureBuffer's texture is used to draw, then draws using the surface | 31 // a PictureBuffer's texture is used to draw, then draws using the surface |
32 // texture's front buffer rather than a copy. To do this, it uses a GLImage | 32 // texture's front buffer rather than a copy. To do this, it uses a GLImage |
33 // implementation to talk to MediaCodec. | 33 // implementation to talk to MediaCodec. |
34 class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy | 34 class MEDIA_GPU_EXPORT AndroidDeferredRenderingBackingStrategy |
35 : public AndroidVideoDecodeAccelerator::BackingStrategy { | 35 : public AndroidVideoDecodeAccelerator::BackingStrategy { |
36 public: | 36 public: |
37 explicit AndroidDeferredRenderingBackingStrategy( | 37 explicit AndroidDeferredRenderingBackingStrategy( |
38 AVDAStateProvider* state_provider); | 38 AVDAStateProvider* state_provider); |
39 ~AndroidDeferredRenderingBackingStrategy() override; | 39 ~AndroidDeferredRenderingBackingStrategy() override; |
40 | 40 |
41 // AndroidVideoDecodeAccelerator::BackingStrategy | 41 // AndroidVideoDecodeAccelerator::BackingStrategy |
42 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; | 42 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; |
43 void Cleanup(bool have_context, | 43 void Cleanup(bool have_context, |
44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // The SurfaceTexture to render to. Non-null after Initialize() if | 90 // The SurfaceTexture to render to. Non-null after Initialize() if |
91 // we're not rendering to a SurfaceView. | 91 // we're not rendering to a SurfaceView. |
92 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 92 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
93 | 93 |
94 media::VideoCodecBridge* media_codec_; | 94 media::VideoCodecBridge* media_codec_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); | 96 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace content | 99 } // namespace media |
100 | 100 |
101 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_
H_ | 101 #endif // MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
OLD | NEW |