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_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ | 5 #ifndef MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
6 #define MEDIA_GPU_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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 // texture's front buffer rather than a copy. To do this, it uses a GLImage | 33 // texture's front buffer rather than a copy. To do this, it uses a GLImage |
34 // implementation to talk to MediaCodec. | 34 // implementation to talk to MediaCodec. |
35 class MEDIA_GPU_EXPORT AndroidDeferredRenderingBackingStrategy | 35 class MEDIA_GPU_EXPORT AndroidDeferredRenderingBackingStrategy |
36 : public AndroidVideoDecodeAccelerator::BackingStrategy { | 36 : public AndroidVideoDecodeAccelerator::BackingStrategy { |
37 public: | 37 public: |
38 explicit AndroidDeferredRenderingBackingStrategy( | 38 explicit AndroidDeferredRenderingBackingStrategy( |
39 AVDAStateProvider* state_provider); | 39 AVDAStateProvider* state_provider); |
40 ~AndroidDeferredRenderingBackingStrategy() override; | 40 ~AndroidDeferredRenderingBackingStrategy() override; |
41 | 41 |
42 // AndroidVideoDecodeAccelerator::BackingStrategy | 42 // AndroidVideoDecodeAccelerator::BackingStrategy |
43 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; | 43 gl::ScopedJavaSurface Initialize(int surface_view_id) override; |
44 void Cleanup( | 44 void Cleanup( |
45 bool have_context, | 45 bool have_context, |
46 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override; | 46 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override; |
47 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; | 47 scoped_refptr<gl::SurfaceTexture> GetSurfaceTexture() const override; |
48 uint32_t GetTextureTarget() const override; | 48 uint32_t GetTextureTarget() const override; |
49 gfx::Size GetPictureBufferSize() const override; | 49 gfx::Size GetPictureBufferSize() const override; |
50 void UseCodecBufferForPictureBuffer( | 50 void UseCodecBufferForPictureBuffer( |
51 int32_t codec_buffer_index, | 51 int32_t codec_buffer_index, |
52 const media::PictureBuffer& picture_buffer) override; | 52 const media::PictureBuffer& picture_buffer) override; |
53 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; | 53 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; |
54 void ReuseOnePictureBuffer( | 54 void ReuseOnePictureBuffer( |
55 const media::PictureBuffer& picture_buffer) override; | 55 const media::PictureBuffer& picture_buffer) override; |
56 void MaybeRenderEarly() override; | 56 void MaybeRenderEarly() override; |
57 void CodecChanged(media::VideoCodecBridge* codec) override; | 57 void CodecChanged(media::VideoCodecBridge* codec) override; |
(...skipping 26 matching lines...) Expand all Loading... |
84 // Return true if and only if CopySurfaceTextureToPictures is expected to work | 84 // Return true if and only if CopySurfaceTextureToPictures is expected to work |
85 // on this device. | 85 // on this device. |
86 bool ShouldCopyPictures() const; | 86 bool ShouldCopyPictures() const; |
87 | 87 |
88 scoped_refptr<AVDASharedState> shared_state_; | 88 scoped_refptr<AVDASharedState> shared_state_; |
89 | 89 |
90 AVDAStateProvider* state_provider_; | 90 AVDAStateProvider* state_provider_; |
91 | 91 |
92 // The SurfaceTexture to render to. Non-null after Initialize() if | 92 // The SurfaceTexture to render to. Non-null after Initialize() if |
93 // we're not rendering to a SurfaceView. | 93 // we're not rendering to a SurfaceView. |
94 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 94 scoped_refptr<gl::SurfaceTexture> surface_texture_; |
95 | 95 |
96 media::VideoCodecBridge* media_codec_; | 96 media::VideoCodecBridge* media_codec_; |
97 | 97 |
98 // Picture buffer IDs that are out for display. Stored in order of frames as | 98 // Picture buffer IDs that are out for display. Stored in order of frames as |
99 // they are returned from the decoder. | 99 // they are returned from the decoder. |
100 std::vector<int32_t> pictures_out_for_display_; | 100 std::vector<int32_t> pictures_out_for_display_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); | 102 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace media | 105 } // namespace media |
106 | 106 |
107 #endif // MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ | 107 #endif // MEDIA_GPU_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
OLD | NEW |