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

Unified Diff: content/renderer/media/video_capture_message_filter.cc

Issue 23551011: From Video Capture, abolish OnFrameInfo and enable resolution changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix constant declaration issue. Created 7 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
Index: content/renderer/media/video_capture_message_filter.cc
diff --git a/content/renderer/media/video_capture_message_filter.cc b/content/renderer/media/video_capture_message_filter.cc
index 0ef77fa1888a641140720f3ff9c531c48dc7cec6..05c925dad7147a87708aa5f930c9a723aaf51392 100644
--- a/content/renderer/media/video_capture_message_filter.cc
+++ b/content/renderer/media/video_capture_message_filter.cc
@@ -60,7 +60,7 @@ bool VideoCaptureMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(VideoCaptureMsg_BufferReady, OnBufferReceived)
IPC_MESSAGE_HANDLER(VideoCaptureMsg_StateChanged, OnDeviceStateChanged)
IPC_MESSAGE_HANDLER(VideoCaptureMsg_NewBuffer, OnBufferCreated)
- IPC_MESSAGE_HANDLER(VideoCaptureMsg_DeviceInfo, OnDeviceInfoReceived)
+ IPC_MESSAGE_HANDLER(VideoCaptureMsg_FreeBuffer, OnBufferDestroyed)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -68,8 +68,6 @@ bool VideoCaptureMessageFilter::OnMessageReceived(const IPC::Message& message) {
void VideoCaptureMessageFilter::OnFilterAdded(IPC::Channel* channel) {
DVLOG(1) << "VideoCaptureMessageFilter::OnFilterAdded()";
- // Captures the message loop proxy for IPC.
- message_loop_proxy_ = base::MessageLoopProxy::current();
channel_ = channel;
for (Delegates::iterator it = pending_delegates_.begin();
@@ -119,7 +117,8 @@ void VideoCaptureMessageFilter::OnBufferCreated(
void VideoCaptureMessageFilter::OnBufferReceived(
int device_id,
int buffer_id,
- base::Time timestamp) {
+ base::Time timestamp,
+ const media::VideoCaptureFormat& format) {
Delegate* delegate = find_delegate(device_id);
if (!delegate) {
DLOG(WARNING) << "OnBufferReceived: Got video frame buffer for a "
@@ -131,31 +130,33 @@ void VideoCaptureMessageFilter::OnBufferReceived(
return;
}
- delegate->OnBufferReceived(buffer_id, timestamp);
+ delegate->OnBufferReceived(buffer_id, timestamp, format);
}
-void VideoCaptureMessageFilter::OnDeviceStateChanged(
+void VideoCaptureMessageFilter::OnBufferDestroyed(
int device_id,
- VideoCaptureState state) {
+ int buffer_id) {
Delegate* delegate = find_delegate(device_id);
if (!delegate) {
- DLOG(WARNING) << "OnDeviceStateChanged: Got video capture event for a "
+ DLOG(WARNING) << "OnBufferDestroyed: Instructed to free buffer for a "
"non-existent or removed video capture.";
return;
}
- delegate->OnStateChanged(state);
+
+ delegate->OnBufferDestroyed(buffer_id);
}
-void VideoCaptureMessageFilter::OnDeviceInfoReceived(
+
+void VideoCaptureMessageFilter::OnDeviceStateChanged(
int device_id,
- const media::VideoCaptureParams& params) {
+ VideoCaptureState state) {
Delegate* delegate = find_delegate(device_id);
if (!delegate) {
- DLOG(WARNING) << "OnDeviceInfoReceived: Got video capture event for a "
+ DLOG(WARNING) << "OnDeviceStateChanged: Got video capture event for a "
"non-existent or removed video capture.";
return;
}
- delegate->OnDeviceInfoReceived(params);
+ delegate->OnStateChanged(state);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698