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

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

Issue 8480028: support video device enumeration from renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/media_stream_impl.cc
===================================================================
--- content/renderer/media/media_stream_impl.cc (revision 111389)
+++ content/renderer/media/media_stream_impl.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/string_util.h"
#include "content/renderer/media/capture_video_decoder.h"
+#include "content/renderer/media/media_stream_dispatcher.h"
#include "content/renderer/media/video_capture_impl_manager.h"
#include "googleurl/src/gurl.h"
#include "media/base/message_loop_factory.h"
@@ -24,8 +25,12 @@
} // namespace
-MediaStreamImpl::MediaStreamImpl(VideoCaptureImplManager* vc_manager)
- : vc_manager_(vc_manager) {
+MediaStreamImpl::MediaStreamImpl(
+ MediaStreamDispatcher* media_stream_dispatcher,
+ VideoCaptureImplManager* vc_manager)
+ : media_stream_dispatcher_(media_stream_dispatcher),
+ vc_manager_(vc_manager) {
+ DCHECK(media_stream_dispatcher);
}
MediaStreamImpl::~MediaStreamImpl() {}
@@ -34,6 +39,9 @@
const GURL& url, media::MessageLoopFactory* message_loop_factory) {
bool raw_media = (url.spec().find(kRawMediaScheme) == 0);
media::VideoDecoder* decoder = NULL;
+ int session_id = media_stream_dispatcher_->video_session_id(local_label_, 0);
+ if (session_id == media_stream::StreamDeviceInfo::kNoId)
+ session_id = kStartOpenSessionId;
if (raw_media) {
media::VideoCapture::VideoCaptureCapability capability;
capability.width = kVideoCaptureWidth;
@@ -45,7 +53,66 @@
decoder = new CaptureVideoDecoder(
message_loop_factory->GetMessageLoopProxy("CaptureVideoDecoder").get(),
- kStartOpenSessionId, vc_manager_.get(), capability);
+ session_id, vc_manager_.get(), capability);
}
return decoder;
}
+
+void MediaStreamImpl::OnStreamGenerated(
+ int request_id,
+ const std::string& label,
+ const media_stream::StreamDeviceInfoArray& audio_array,
+ const media_stream::StreamDeviceInfoArray& video_array) {
+ DVLOG(1) << "MediaStreamImpl::OnStreamGenerated("
+ << request_id << ", " << label << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnStreamGenerationFailed(int request_id) {
+ DVLOG(1) << "MediaStreamImpl::OnStreamGenerationFailed("
+ << request_id << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnVideoDeviceFailed(const std::string& label,
+ int index) {
+ DVLOG(1) << "MediaStreamImpl::OnVideoDeviceFailed("
+ << label << ", " << index << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnAudioDeviceFailed(const std::string& label,
+ int index) {
+ DVLOG(1) << "MediaStreamImpl::OnAudioDeviceFailed("
+ << label << ", " << index << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnVideoDevicesEnumerated(
+ int request_id,
+ const media_stream::StreamDeviceInfoArray& device_array) {
+ DVLOG(1) << "MediaStreamImpl::OnVideoDevicesEnumerated("
+ << request_id << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnVideoDevicesEnumerationFailed(int request_id) {
+ DVLOG(1) << "MediaStreamImpl::OnVideoDevicesEnumerationFailed("
+ << request_id << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnVideoDeviceOpened(
+ int request_id,
+ const std::string& label,
+ const media_stream::StreamDeviceInfo& video_device) {
+ DVLOG(1) << "MediaStreamImpl::OnVideoDeviceOpened("
+ << request_id << ", " << label << ")";
+ NOTIMPLEMENTED();
+}
+
+void MediaStreamImpl::OnVideoDeviceOpenFailed(int request_id) {
+ DVLOG(1) << "MediaStreamImpl::VideoDeviceOpenFailed("
+ << request_id << ")";
+ NOTIMPLEMENTED();
+}

Powered by Google App Engine
This is Rietveld 408576698