Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class AVDAStateProvider; | 24 class AVDAStateProvider; |
| 25 | 25 |
| 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 AndroidCopyingBackingStrategy(); | 31 AndroidCopyingBackingStrategy(AVDAStateProvider* state_provider); |
| 32 ~AndroidCopyingBackingStrategy() override; | 32 ~AndroidCopyingBackingStrategy() override; |
| 33 | 33 |
| 34 // AndroidVideoDecodeAccelerator::BackingStrategy | 34 // AndroidVideoDecodeAccelerator::BackingStrategy |
| 35 void Initialize(AVDAStateProvider*) override; | 35 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; |
| 36 void Cleanup(bool have_context, | 36 void Cleanup(bool have_context, |
| 37 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 37 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; |
| 38 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; | |
| 38 uint32_t GetTextureTarget() const override; | 39 uint32_t GetTextureTarget() const override; |
| 39 scoped_refptr<gfx::SurfaceTexture> CreateSurfaceTexture() override; | |
| 40 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, | 40 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, |
| 41 const media::PictureBuffer&) override; | 41 const media::PictureBuffer&) override; |
| 42 void CodecChanged( | 42 void CodecChanged( |
| 43 media::VideoCodecBridge*, | 43 media::VideoCodecBridge*, |
| 44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; |
| 45 void OnFrameAvailable() override; | 45 void OnFrameAvailable() override; |
| 46 bool PicturesAreOverlayable() override; | |
|
sandersd (OOO until July 31)
2016/02/01 19:58:26
Nit: ArePicturesOverlayable()
| |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 // Used for copy the texture from surface texture to picture buffers. | 49 // Used for copy the texture from surface texture to picture buffers. |
| 49 scoped_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_; | 50 scoped_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_; |
| 50 | 51 |
| 51 AVDAStateProvider* state_provider_; | 52 AVDAStateProvider* state_provider_; |
| 52 | 53 |
| 53 // A container of texture. Used to set a texture to |media_codec_|. | 54 // A container of texture. Used to set a texture to |media_codec_|. |
| 54 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 55 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
| 55 | 56 |
| 56 // The texture id which is set to |surface_texture_|. | 57 // The texture id which is set to |surface_texture_|. |
| 57 uint32_t surface_texture_id_; | 58 uint32_t surface_texture_id_; |
| 58 | 59 |
| 59 media::VideoCodecBridge* media_codec_; | 60 media::VideoCodecBridge* media_codec_; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace content | 63 } // namespace content |
| 63 | 64 |
| 64 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ | 65 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
| OLD | NEW |