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_COPYING_BACKING_STRATEGY_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 17 matching lines...) Expand all Loading... |
28 // A BackingStrategy implementation that copies images to PictureBuffer | 28 // A BackingStrategy implementation that copies images to PictureBuffer |
29 // textures via gpu texture copy. | 29 // textures via gpu texture copy. |
30 class CONTENT_EXPORT AndroidCopyingBackingStrategy | 30 class CONTENT_EXPORT AndroidCopyingBackingStrategy |
31 : public AndroidVideoDecodeAccelerator::BackingStrategy { | 31 : public AndroidVideoDecodeAccelerator::BackingStrategy { |
32 public: | 32 public: |
33 explicit AndroidCopyingBackingStrategy(AVDAStateProvider* state_provider); | 33 explicit AndroidCopyingBackingStrategy(AVDAStateProvider* state_provider); |
34 ~AndroidCopyingBackingStrategy() override; | 34 ~AndroidCopyingBackingStrategy() override; |
35 | 35 |
36 // AndroidVideoDecodeAccelerator::BackingStrategy | 36 // AndroidVideoDecodeAccelerator::BackingStrategy |
37 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; | 37 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; |
38 void Cleanup(bool have_context, | 38 void Cleanup( |
39 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 39 bool have_context, |
| 40 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override; |
40 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; | 41 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; |
41 uint32_t GetTextureTarget() const override; | 42 uint32_t GetTextureTarget() const override; |
42 gfx::Size GetPictureBufferSize() const override; | 43 gfx::Size GetPictureBufferSize() const override; |
43 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, | 44 void UseCodecBufferForPictureBuffer( |
44 const media::PictureBuffer&) override; | 45 int32_t codec_buffer_index, |
45 void CodecChanged(media::VideoCodecBridge*) override; | 46 const media::PictureBuffer& picture_buffer) override; |
| 47 void CodecChanged(media::VideoCodecBridge* codec) override; |
46 void OnFrameAvailable() override; | 48 void OnFrameAvailable() override; |
47 bool ArePicturesOverlayable() override; | 49 bool ArePicturesOverlayable() override; |
48 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, | 50 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, |
49 const gfx::Size& new_size) override; | 51 const gfx::Size& new_size) override; |
50 | 52 |
51 private: | 53 private: |
52 // Used for copy the texture from surface texture to picture buffers. | 54 // Used for copy the texture from surface texture to picture buffers. |
53 std::unique_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_; | 55 std::unique_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_; |
54 | 56 |
55 AVDAStateProvider* state_provider_; | 57 AVDAStateProvider* state_provider_; |
56 | 58 |
57 // A container of texture. Used to set a texture to |media_codec_|. | 59 // A container of texture. Used to set a texture to |media_codec_|. |
58 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 60 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
59 | 61 |
60 // The texture id which is set to |surface_texture_|. | 62 // The texture id which is set to |surface_texture_|. |
61 uint32_t surface_texture_id_; | 63 uint32_t surface_texture_id_; |
62 | 64 |
63 media::VideoCodecBridge* media_codec_; | 65 media::VideoCodecBridge* media_codec_; |
64 }; | 66 }; |
65 | 67 |
66 } // namespace content | 68 } // namespace content |
67 | 69 |
68 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ | 70 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
OLD | NEW |