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

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: Cleanup. 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 #include <vector>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
12 #include "content/common/gpu/media/android_video_decode_accelerator.h" 13 #include "content/common/gpu/media/android_video_decode_accelerator.h"
13 14
14 namespace gl { 15 namespace gl {
15 class GLImage; 16 class GLImage;
16 } 17 }
17 18
18 namespace gpu { 19 namespace gpu {
(...skipping 14 matching lines...) Expand all
33 // implementation to talk to MediaCodec. 34 // implementation to talk to MediaCodec.
34 class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy 35 class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy
35 : public AndroidVideoDecodeAccelerator::BackingStrategy { 36 : public AndroidVideoDecodeAccelerator::BackingStrategy {
36 public: 37 public:
37 explicit AndroidDeferredRenderingBackingStrategy( 38 explicit AndroidDeferredRenderingBackingStrategy(
38 AVDAStateProvider* state_provider); 39 AVDAStateProvider* state_provider);
39 ~AndroidDeferredRenderingBackingStrategy() override; 40 ~AndroidDeferredRenderingBackingStrategy() override;
40 41
41 // AndroidVideoDecodeAccelerator::BackingStrategy 42 // AndroidVideoDecodeAccelerator::BackingStrategy
42 gfx::ScopedJavaSurface Initialize(int surface_view_id) override; 43 gfx::ScopedJavaSurface Initialize(int surface_view_id) override;
43 void Cleanup(bool have_context, 44 void Cleanup(
44 const AndroidVideoDecodeAccelerator::OutputBufferMap&) override; 45 bool have_context,
46 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override;
45 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override; 47 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override;
46 uint32_t GetTextureTarget() const override; 48 uint32_t GetTextureTarget() const override;
47 gfx::Size GetPictureBufferSize() const override; 49 gfx::Size GetPictureBufferSize() const override;
48 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, 50 void UseCodecBufferForPictureBuffer(
49 const media::PictureBuffer&) override; 51 int32_t codec_buffer_index,
52 const media::PictureBuffer& picture_buffer) 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) override;
56 void MaybeRenderEarly() override;
57 void CodecChanged(media::VideoCodecBridge* codec) override;
53 void OnFrameAvailable() override; 58 void OnFrameAvailable() override;
54 bool ArePicturesOverlayable() override; 59 bool ArePicturesOverlayable() override;
55 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, 60 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer,
56 const gfx::Size& new_size) override; 61 const gfx::Size& new_size) override;
57 62
58 private: 63 private:
59 // Release any codec buffer that is associated with the given picture buffer 64 // 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. 65 // back to the codec. It is okay if there is no such buffer.
61 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer); 66 void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer);
62 67
(...skipping 22 matching lines...) Expand all
85 scoped_refptr<AVDASharedState> shared_state_; 90 scoped_refptr<AVDASharedState> shared_state_;
86 91
87 AVDAStateProvider* state_provider_; 92 AVDAStateProvider* state_provider_;
88 93
89 // The SurfaceTexture to render to. Non-null after Initialize() if 94 // The SurfaceTexture to render to. Non-null after Initialize() if
90 // we're not rendering to a SurfaceView. 95 // we're not rendering to a SurfaceView.
91 scoped_refptr<gfx::SurfaceTexture> surface_texture_; 96 scoped_refptr<gfx::SurfaceTexture> surface_texture_;
92 97
93 media::VideoCodecBridge* media_codec_; 98 media::VideoCodecBridge* media_codec_;
94 99
100 // Picture buffer IDs that are out for display. Stored in order of frames as
101 // they are returned from the decoder.
102 std::vector<int32_t> pictures_out_for_display_;
103
95 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy); 104 DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy);
96 }; 105 };
97 106
98 } // namespace content 107 } // namespace content
99 108
100 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_ H_ 109 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698