Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Side by Side Diff: content/common/gpu/media/android_deferred_rendering_backing_strategy.h

Issue 1892013002: ReleaseOutputBuffer to surface back and front buffers where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanerer. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 // implementation to talk to MediaCodec. 33 // implementation to talk to MediaCodec.
34 class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy 34 class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy
35 : public AndroidVideoDecodeAccelerator::BackingStrategy { 35 : public AndroidVideoDecodeAccelerator::BackingStrategy {
36 public: 36 public:
37 explicit AndroidDeferredRenderingBackingStrategy( 37 explicit AndroidDeferredRenderingBackingStrategy(
38 AVDAStateProvider* state_provider); 38 AVDAStateProvider* state_provider);
39 ~AndroidDeferredRenderingBackingStrategy() override; 39 ~AndroidDeferredRenderingBackingStrategy() override;
40 40
41 // AndroidVideoDecodeAccelerator::BackingStrategy 41 // AndroidVideoDecodeAccelerator::BackingStrategy
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(
44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; 44 bool have_context,
45 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override;
45 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; 46 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override;
46 uint32_t GetTextureTarget() const override; 47 uint32_t GetTextureTarget() const override;
47 gfx::Size GetPictureBufferSize() const override; 48 gfx::Size GetPictureBufferSize() const override;
48 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, 49 void UseCodecBufferForPictureBuffer(
49 const media::PictureBuffer&) override; 50 int32_t codec_buffer_index,
51 const media::PictureBuffer& picture_buffer,
52 const std::vector<int32_t>& pictures_out_for_display) override;
50 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; 53 void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override;
51 void ReuseOnePictureBuffer(const media::PictureBuffer&) override; 54 void ReuseOnePictureBuffer(
52 void CodecChanged(media::VideoCodecBridge*) override; 55 const media::PictureBuffer& picture_buffer,
56 const std::vector<int32_t>& pictures_out_for_display) override;
57 void MaybeRenderEarly(
58 const std::vector<int32_t>& pictures_out_for_display) override;
59 void CodecChanged(media::VideoCodecBridge* codec) override;
53 void OnFrameAvailable() override; 60 void OnFrameAvailable() override;
54 bool ArePicturesOverlayable() override; 61 bool ArePicturesOverlayable() override;
55 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, 62 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer,
56 const gfx::Size& new_size) override; 63 const gfx::Size& new_size) override;
57 64
58 private: 65 private:
59 // Release any codec buffer that is associated with the given picture buffer 66 // 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. 67 // back to the codec. It is okay if there is no such buffer.
61 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); 68 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer);
62 69
(...skipping 26 matching lines...) Expand all
89 scoped_refptr<gfx::SurfaceTexture> surface_texture_; 96 scoped_refptr<gfx::SurfaceTexture> surface_texture_;
90 97
91 media::VideoCodecBridge* media_codec_; 98 media::VideoCodecBridge* media_codec_;
92 99
93 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); 100 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy);
94 }; 101 };
95 102
96 } // namespace content 103 } // namespace content
97 104
98 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_ H_ 105 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698