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::OnDevicesEnumerated( |
+ int request_id, |
+ const media_stream::StreamDeviceInfoArray& device_array) { |
+ DVLOG(1) << "MediaStreamImpl::OnDevicesEnumerated(" |
+ << request_id << ")"; |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void MediaStreamImpl::OnDevicesEnumerationFailed(int request_id) { |
+ DVLOG(1) << "MediaStreamImpl::OnDevicesEnumerationFailed(" |
+ << request_id << ")"; |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void MediaStreamImpl::OnDeviceOpened( |
+ int request_id, |
+ const std::string& label, |
+ const media_stream::StreamDeviceInfo& video_device) { |
+ DVLOG(1) << "MediaStreamImpl::OnDeviceOpened(" |
+ << request_id << ", " << label << ")"; |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void MediaStreamImpl::OnDeviceOpenFailed(int request_id) { |
+ DVLOG(1) << "MediaStreamImpl::VideoDeviceOpenFailed(" |
+ << request_id << ")"; |
+ NOTIMPLEMENTED(); |
+} |