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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.h

Issue 2607203002: [Mojo Video Capture] Retire buffers when Android Chromium goes to the background (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_controller.h
diff --git a/content/browser/renderer_host/media/video_capture_controller.h b/content/browser/renderer_host/media/video_capture_controller.h
index 76e59cb29b1ab6beb719d4cf6f65f10cfd77a115..b6f8a89852cb6053c31a3f9fe537c500e9fa072d 100644
--- a/content/browser/renderer_host/media/video_capture_controller.h
+++ b/content/browser/renderer_host/media/video_capture_controller.h
@@ -134,7 +134,7 @@ class CONTENT_EXPORT VideoCaptureController : public media::VideoFrameReceiver {
scoped_refptr<media::VideoFrame> frame) override;
void OnError() override;
void OnLog(const std::string& message) override;
- void OnBufferDestroyed(int buffer_id_to_drop) override;
+ void OnBufferRetired(int buffer_id) override;
private:
struct ControllerClient;
@@ -149,6 +149,10 @@ class CONTENT_EXPORT VideoCaptureController : public media::VideoFrameReceiver {
media::FrameBufferPool* frame_buffer_pool);
~BufferState();
BufferState(const BufferState& other);
+ BufferState& operator=(const BufferState& other);
+ int buffer_id() const { return buffer_id_; }
+ bool is_retired() const { return is_retired_; }
+ void set_is_retired() { is_retired_ = true; }
void RecordConsumerUtilization(double utilization);
void IncreaseConsumerCount();
void DecreaseConsumerCount();
@@ -158,8 +162,9 @@ class CONTENT_EXPORT VideoCaptureController : public media::VideoFrameReceiver {
void SetFrameBufferPool(media::FrameBufferPool* frame_buffer_pool);
private:
- const int buffer_id_;
- const int frame_feedback_id_;
+ int buffer_id_;
+ bool is_retired_ = false;
+ int frame_feedback_id_;
media::VideoFrameConsumerFeedbackObserver* consumer_feedback_observer_;
media::FrameBufferPool* frame_buffer_pool_;
double max_consumer_utilization_;
@@ -175,12 +180,18 @@ class CONTENT_EXPORT VideoCaptureController : public media::VideoFrameReceiver {
ControllerClient* FindClient(int session_id,
const ControllerClients& clients);
+ void OnClientFinishedConsumingBuffer(ControllerClient* client,
+ int buffer_id,
+ double consumer_resource_utilization);
+ void ReleaseBufferState(
+ const std::vector<BufferState>::iterator& buffer_state_iter);
+
std::unique_ptr<media::FrameBufferPool> frame_buffer_pool_;
std::unique_ptr<media::VideoFrameConsumerFeedbackObserver>
consumer_feedback_observer_;
- std::map<int, BufferState> buffer_id_to_state_map_;
+ std::vector<BufferState> buffer_states_;
// All clients served by this controller.
ControllerClients controller_clients_;

Powered by Google App Engine
This is Rietveld 408576698