| 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 CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, | 47 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, |
| 48 const media::PictureBuffer&) override; | 48 const media::PictureBuffer&) override; |
| 49 void AssignOnePictureBuffer(const media::PictureBuffer&) override; | 49 void AssignOnePictureBuffer(const media::PictureBuffer&) override; |
| 50 void ReuseOnePictureBuffer(const media::PictureBuffer&) override; | 50 void ReuseOnePictureBuffer(const media::PictureBuffer&) override; |
| 51 void DismissOnePictureBuffer(const media::PictureBuffer&) override; | 51 void DismissOnePictureBuffer(const media::PictureBuffer&) override; |
| 52 void CodecChanged( | 52 void CodecChanged( |
| 53 media::VideoCodecBridge*, | 53 media::VideoCodecBridge*, |
| 54 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 54 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; |
| 55 void OnFrameAvailable() override; | 55 void OnFrameAvailable() override; |
| 56 bool ArePicturesOverlayable() override; | 56 bool ArePicturesOverlayable() override; |
| 57 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, |
| 58 const gfx::Size& new_size) override; |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 // Release any codec buffer that is associated with the given picture buffer | 61 // Release any codec buffer that is associated with the given picture buffer |
| 60 // back to the codec. It is okay if there is no such buffer. | 62 // back to the codec. It is okay if there is no such buffer. |
| 61 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); | 63 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); |
| 62 | 64 |
| 63 // Return the TextureRef for a given PictureBuffer's texture. | |
| 64 gpu::gles2::TextureRef* GetTextureForPicture(const media::PictureBuffer&); | |
| 65 | |
| 66 // Return the AVDACodecImage for a given PictureBuffer's texture. | 65 // Return the AVDACodecImage for a given PictureBuffer's texture. |
| 67 AVDACodecImage* GetImageForPicture(const media::PictureBuffer&); | 66 AVDACodecImage* GetImageForPicture(const media::PictureBuffer&); |
| 68 void SetImageForPicture( | 67 void SetImageForPicture( |
| 69 const media::PictureBuffer& picture_buffer, | 68 const media::PictureBuffer& picture_buffer, |
| 70 const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image); | 69 const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image); |
| 71 | 70 |
| 72 // Make a copy of the SurfaceTexture's front buffer and associate all given | 71 // Make a copy of the SurfaceTexture's front buffer and associate all given |
| 73 // picture buffer textures with it. The picture buffer textures will not | 72 // picture buffer textures with it. The picture buffer textures will not |
| 74 // dependend on |this|, the SurfaceTexture, the MediaCodec or the VDA, so it's | 73 // dependend on |this|, the SurfaceTexture, the MediaCodec or the VDA, so it's |
| 75 // used to back the picture buffers when the VDA is being destroyed. | 74 // used to back the picture buffers when the VDA is being destroyed. |
| 76 void CopySurfaceTextureToPictures( | 75 void CopySurfaceTextureToPictures( |
| 77 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers); | 76 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers); |
| 78 | 77 |
| 79 scoped_refptr<AVDASharedState> shared_state_; | 78 scoped_refptr<AVDASharedState> shared_state_; |
| 80 | 79 |
| 81 AVDAStateProvider* state_provider_; | 80 AVDAStateProvider* state_provider_; |
| 82 | 81 |
| 83 // The SurfaceTexture to render to. Non-null after Initialize() if | 82 // The SurfaceTexture to render to. Non-null after Initialize() if |
| 84 // we're not rendering to a SurfaceView. | 83 // we're not rendering to a SurfaceView. |
| 85 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 84 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
| 86 | 85 |
| 87 media::VideoCodecBridge* media_codec_; | 86 media::VideoCodecBridge* media_codec_; |
| 88 | 87 |
| 89 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); | 88 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 } // namespace content | 91 } // namespace content |
| 93 | 92 |
| 94 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_
H_ | 93 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_
H_ |
| OLD | NEW |