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_video_decode_accelerator.h

Issue 1750213002: Fix Android black frames from MSE config changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // per-image cleanup is needed. 91 // per-image cleanup is needed.
92 virtual void CodecChanged(media::VideoCodecBridge* codec, 92 virtual void CodecChanged(media::VideoCodecBridge* codec,
93 const OutputBufferMap& buffer_map) = 0; 93 const OutputBufferMap& buffer_map) = 0;
94 94
95 // Notify the strategy that a frame is available. This callback can happen 95 // Notify the strategy that a frame is available. This callback can happen
96 // on any thread at any time. 96 // on any thread at any time.
97 virtual void OnFrameAvailable() = 0; 97 virtual void OnFrameAvailable() = 0;
98 98
99 // Whether the pictures produced by this backing strategy are overlayable. 99 // Whether the pictures produced by this backing strategy are overlayable.
100 virtual bool ArePicturesOverlayable() = 0; 100 virtual bool ArePicturesOverlayable() = 0;
101
102 // Size may have changed due to resolution change since the last time this
103 // PictureBuffer was used. Update the size of the picture buffer to
104 // |new_size| and also update any size-dependent state (e.g. size of
105 // associated texture). Callers should set the correct GL context prior to
106 // calling.
107 virtual void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer,
108 const gfx::Size& new_size);
101 }; 109 };
102 110
103 AndroidVideoDecodeAccelerator( 111 AndroidVideoDecodeAccelerator(
104 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, 112 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
105 const base::Callback<bool(void)>& make_context_current); 113 const base::Callback<bool(void)>& make_context_current);
106 114
107 ~AndroidVideoDecodeAccelerator() override; 115 ~AndroidVideoDecodeAccelerator() override;
108 116
109 // media::VideoDecodeAccelerator implementation: 117 // media::VideoDecodeAccelerator implementation:
110 bool Initialize(const Config& config, Client* client) override; 118 bool Initialize(const Config& config, Client* client) override;
111 void SetCdm(int cdm_id) override; 119 void SetCdm(int cdm_id) override;
112 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; 120 void Decode(const media::BitstreamBuffer& bitstream_buffer) override;
113 void AssignPictureBuffers( 121 void AssignPictureBuffers(
114 const std::vector<media::PictureBuffer>& buffers) override; 122 const std::vector<media::PictureBuffer>& buffers) override;
115 void ReusePictureBuffer(int32_t picture_buffer_id) override; 123 void ReusePictureBuffer(int32_t picture_buffer_id) override;
116 void Flush() override; 124 void Flush() override;
117 void Reset() override; 125 void Reset() override;
118 void Destroy() override; 126 void Destroy() override;
119 bool CanDecodeOnIOThread() override; 127 bool CanDecodeOnIOThread() override;
120 128
121 // AVDAStateProvider implementation: 129 // AVDAStateProvider implementation:
122 const gfx::Size& GetSize() const override; 130 const gfx::Size& GetSize() const override;
123 const base::ThreadChecker& ThreadChecker() const override; 131 const base::ThreadChecker& ThreadChecker() const override;
124 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; 132 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override;
133 gpu::gles2::TextureRef* GetTextureForPicture(
134 const media::PictureBuffer& picture_buffer) override;
125 void PostError(const ::tracked_objects::Location& from_here, 135 void PostError(const ::tracked_objects::Location& from_here,
126 media::VideoDecodeAccelerator::Error error) override; 136 media::VideoDecodeAccelerator::Error error) override;
127 137
128 static media::VideoDecodeAccelerator::Capabilities GetCapabilities(); 138 static media::VideoDecodeAccelerator::Capabilities GetCapabilities();
129 139
130 // Notifies about SurfaceTexture::OnFrameAvailable. This can happen on any 140 // Notifies about SurfaceTexture::OnFrameAvailable. This can happen on any
131 // thread at any time! 141 // thread at any time!
132 void OnFrameAvailable(); 142 void OnFrameAvailable();
133 143
134 private: 144 private:
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 334
325 // WeakPtrFactory for posting tasks back to |this|. 335 // WeakPtrFactory for posting tasks back to |this|.
326 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 336 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
327 337
328 friend class AndroidVideoDecodeAcceleratorTest; 338 friend class AndroidVideoDecodeAcceleratorTest;
329 }; 339 };
330 340
331 } // namespace content 341 } // namespace content
332 342
333 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 343 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698