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

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

Issue 2393483002: Revert of VideoCapture: migrate VideoCapture renderer-->host messages to mojo, part 1 (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_host.h
diff --git a/content/browser/renderer_host/media/video_capture_host.h b/content/browser/renderer_host/media/video_capture_host.h
index 5306f645ad792d4bb3663861d586019944b9fb9d..90f1dc939be7f074332c5ac4a7f12096c09fb02f 100644
--- a/content/browser/renderer_host/media/video_capture_host.h
+++ b/content/browser/renderer_host/media/video_capture_host.h
@@ -42,7 +42,7 @@
// | ... |
// | |
// | < VideoCaptureMsg_BufferReady |
-// | --------- StopCapture ---------> |
+// | VideoCaptureHostMsg_Stop > |
// | VideoCaptureHostMsg_BufferReady > |
// | < VideoCaptureMsg_StateChanged |
// | (VIDEO_CAPTURE_STATE_STOPPED) |
@@ -60,8 +60,6 @@
#include "content/browser/renderer_host/media/video_capture_controller.h"
#include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
#include "content/common/content_export.h"
-#include "content/common/video_capture.mojom.h"
-#include "content/public/browser/browser_associated_interface.h"
#include "content/public/browser/browser_message_filter.h"
#include "ipc/ipc_message.h"
@@ -70,9 +68,7 @@
class CONTENT_EXPORT VideoCaptureHost
: public BrowserMessageFilter,
- public VideoCaptureControllerEventHandler,
- public BrowserAssociatedInterface<mojom::VideoCaptureRendererToBrowser>,
- public mojom::VideoCaptureRendererToBrowser {
+ public VideoCaptureControllerEventHandler {
public:
explicit VideoCaptureHost(MediaStreamManager* media_stream_manager);
@@ -109,31 +105,49 @@
~VideoCaptureHost() override;
- // IPC message handlers.
+ // IPC message: Start capture on the VideoCaptureDevice referenced by
+ // |device_id|. |session_id| is an id created by VideoCaptureMessageFilter
+ // to identify a session between a VideoCaptureMessageFilter and a
+ // VideoCaptureHost.
void OnStartCapture(int device_id,
media::VideoCaptureSessionId session_id,
const media::VideoCaptureParams& params);
+ void OnControllerAdded(
+ int device_id,
+ const base::WeakPtr<VideoCaptureController>& controller);
+
+ // IPC message: Stop capture on device referenced by |device_id|.
+ void OnStopCapture(int device_id);
+
+ // IPC message: Pause capture on device referenced by |device_id|.
+ void OnPauseCapture(int device_id);
+
void OnResumeCapture(int device_id,
media::VideoCaptureSessionId session_id,
const media::VideoCaptureParams& params);
+
+ // IPC message: Requests that the video capture send a frame "soon" (e.g., to
+ // resolve picture loss or quality issues).
+ void OnRequestRefreshFrame(int device_id);
+
+ // IPC message: Called when a renderer is finished using a buffer. Notifies
+ // the controller.
void OnRendererFinishedWithBuffer(int device_id,
int buffer_id,
const gpu::SyncToken& sync_token,
double consumer_resource_utilization);
+
+ // IPC message: Get supported formats referenced by |capture_session_id|.
+ // |device_id| is needed for message back-routing purposes.
void OnGetDeviceSupportedFormats(
int device_id,
media::VideoCaptureSessionId capture_session_id);
+
+ // IPC message: Get a device's currently in use format(s), referenced by
+ // |capture_session_id|. |device_id| is needed for message back-routing
+ // purposes.
void OnGetDeviceFormatsInUse(int device_id,
media::VideoCaptureSessionId capture_session_id);
-
- // mojom::VideoCaptureRendererToBrowser implementation
- void StopCapture(int32_t device_id) override;
- void PauseCapture(int32_t device_id) override;
- void RequestRefreshFrame(int32_t device_id) override;
-
- void OnControllerAdded(
- int device_id,
- const base::WeakPtr<VideoCaptureController>& controller);
// Deletes the controller and notifies the VideoCaptureManager. |on_error| is
// true if this is triggered by VideoCaptureControllerEventHandler::OnError.
@@ -142,11 +156,13 @@
MediaStreamManager* const media_stream_manager_;
+ typedef std::map<VideoCaptureControllerID,
+ base::WeakPtr<VideoCaptureController>> EntryMap;
+
// A map of VideoCaptureControllerID to the VideoCaptureController to which it
// is connected. An entry in this map holds a null controller while it is in
// the process of starting.
- std::map<VideoCaptureControllerID, base::WeakPtr<VideoCaptureController>>
- controllers_;
+ EntryMap entries_;
DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost);
};
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698