| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; | 42 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; |
| 43 void Cleanup(bool have_context, | 43 void Cleanup(bool have_context, |
| 44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | 44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; |
| 45 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; | 45 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; |
| 46 uint32_t GetTextureTarget() const override; | 46 uint32_t GetTextureTarget() const override; |
| 47 gfx::Size GetPictureBufferSize() const override; | 47 gfx::Size GetPictureBufferSize() const override; |
| 48 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, | 48 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, |
| 49 const media::PictureBuffer&) override; | 49 const media::PictureBuffer&) override; |
| 50 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; | 50 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; |
| 51 void ReuseOnePictureBuffer(const media::PictureBuffer&) override; | 51 void ReuseOnePictureBuffer(const media::PictureBuffer&) override; |
| 52 void CodecChanged( | 52 void CodecChanged(media::VideoCodecBridge*) override; |
| 53 media::VideoCodecBridge*, | |
| 54 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; | |
| 55 void OnFrameAvailable() override; | 53 void OnFrameAvailable() override; |
| 56 bool ArePicturesOverlayable() override; | 54 bool ArePicturesOverlayable() override; |
| 57 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, | 55 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, |
| 58 const gfx::Size& new_size) override; | 56 const gfx::Size& new_size) override; |
| 59 | 57 |
| 60 private: | 58 private: |
| 61 // Release any codec buffer that is associated with the given picture buffer | 59 // Release any codec buffer that is associated with the given picture buffer |
| 62 // back to the codec. It is okay if there is no such buffer. | 60 // back to the codec. It is okay if there is no such buffer. |
| 63 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); | 61 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); |
| 64 | 62 |
| 65 // Return the AVDACodecImage for a given PictureBuffer's texture. | 63 // Sets up the texture references (as found by |picture_buffer|), for the |
| 66 AVDACodecImage* GetImageForPicture(const media::PictureBuffer&); | 64 // specified |image|. If |image| is null, clears any ref on the texture |
| 65 // associated with |picture_buffer|. |
| 67 void SetImageForPicture( | 66 void SetImageForPicture( |
| 68 const media::PictureBuffer& picture_buffer, | 67 const media::PictureBuffer& picture_buffer, |
| 69 const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image); | 68 const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image); |
| 70 | 69 |
| 71 // Make a copy of the SurfaceTexture's front buffer and associate all given | 70 // Make a copy of the SurfaceTexture's front buffer and associate all given |
| 72 // picture buffer textures with it. The picture buffer textures will not | 71 // picture buffer textures with it. The picture buffer textures will not |
| 73 // dependend on |this|, the SurfaceTexture, the MediaCodec or the VDA, so it's | 72 // dependend on |this|, the SurfaceTexture, the MediaCodec or the VDA, so it's |
| 74 // used to back the picture buffers when the VDA is being destroyed. | 73 // used to back the picture buffers when the VDA is being destroyed. |
| 75 void CopySurfaceTextureToPictures( | 74 void CopySurfaceTextureToPictures( |
| 76 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers); | 75 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 92 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 91 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
| 93 | 92 |
| 94 media::VideoCodecBridge* media_codec_; | 93 media::VideoCodecBridge* media_codec_; |
| 95 | 94 |
| 96 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); | 95 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 } // namespace content | 98 } // namespace content |
| 100 | 99 |
| 101 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_
H_ | 100 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_
H_ |
| OLD | NEW |