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