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

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

Issue 8480028: support video device enumeration from renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: simplify interface between MSManager and MSDevieSettings 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.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);
« no previous file with comments | « content/renderer/media/media_stream_dispatcher_unittest.cc ('k') | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698