Index: content/renderer/media/media_stream_impl.h |
=================================================================== |
--- content/renderer/media/media_stream_impl.h (revision 109718) |
+++ content/renderer/media/media_stream_impl.h (working copy) |
@@ -6,25 +6,61 @@ |
#define CONTENT_RENDERER_MEDIA_STREAM_MEDIA_STREAM_IMPL_H_ |
#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
#include "base/memory/ref_counted.h" |
+#include "content/renderer/media/media_stream_dispatcher_eventhandler.h" |
#include "webkit/glue/media/media_stream_client.h" |
+class MediaStreamDispatcher; |
class VideoCaptureImplManager; |
// A implementation of StreamClient to provide supporting functions, such as |
// GetVideoDecoder. |
class MediaStreamImpl |
: public webkit_glue::MediaStreamClient, |
+ public MediaStreamDispatcherEventHandler, |
public base::RefCountedThreadSafe<MediaStreamImpl> { |
public: |
- explicit MediaStreamImpl(VideoCaptureImplManager* vc_manager); |
+ explicit MediaStreamImpl(MediaStreamDispatcher* media_stream_dispatcher_, |
+ VideoCaptureImplManager* vc_manager); |
virtual ~MediaStreamImpl(); |
+ virtual void GetVideoDevice(int index); |
+ |
// Implement webkit_glue::StreamClient. |
virtual scoped_refptr<media::VideoDecoder> GetVideoDecoder( |
- const GURL& url, media::MessageLoopFactory* message_loop_factory); |
+ const GURL& url, |
+ media::MessageLoopFactory* message_loop_factory) OVERRIDE; |
+ // Implement MediaStreamDispatcherEventHandler. |
+ virtual void OnStreamGenerated( |
+ int request_id, |
+ const std::string& label, |
+ const media_stream::StreamDeviceInfoArray& audio_array, |
+ const media_stream::StreamDeviceInfoArray& video_array) OVERRIDE; |
+ virtual void OnStreamGenerationFailed(int request_id) OVERRIDE; |
+ virtual void OnVideoDeviceFailed( |
+ const std::string& label, |
+ int index) OVERRIDE; |
+ virtual void OnAudioDeviceFailed( |
+ const std::string& label, |
+ int index) OVERRIDE; |
+ virtual void OnVideoDevicesEnumerated( |
+ int request_id, |
+ const media_stream::StreamDeviceInfoArray& device_array) OVERRIDE; |
+ virtual void OnVideoDevicesEnumerationFailed(int request_id) OVERRIDE; |
+ virtual void OnVideoDeviceOpened( |
+ int request_id, |
+ const std::string& label, |
+ const media_stream::StreamDeviceInfo& video_device) OVERRIDE; |
+ virtual void OnVideoDeviceOpenFailed(int request_id) OVERRIDE; |
+ |
private: |
+ // media_stream_dispatcher_ is a weak reference, owned by RenderView. It's |
+ // valid for the lifetime of RenderView. |
+ MediaStreamDispatcher* media_stream_dispatcher_; |
+ |
+ std::string local_label_; |
scoped_refptr<VideoCaptureImplManager> vc_manager_; |
DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); |