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

Unified Diff: content/browser/media_stream/media_stream_provider.h

Issue 6946001: VideoCaptureManager opens/closes, starts/stops and enumerates video capture devices. VideoCapture... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 8 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/browser/media_stream/media_stream_provider.h
===================================================================
--- content/browser/media_stream/media_stream_provider.h (revision 0)
+++ content/browser/media_stream/media_stream_provider.h (revision 0)
@@ -0,0 +1,92 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_MEDIA_STREAM_MEDIA_STREAM_PROVIDER_H_
+#define CONTENT_BROWSER_MEDIA_STREAM_MEDIA_STREAM_PROVIDER_H_
+
+#include <list>
+#include <string>
+
+namespace media_stream {
+
+typedef int MediaCaptureSessionId;
wjia(left Chromium) 2011/05/06 00:11:31 Is this the same SessionId received by VideoCaptur
mflodman1 2011/05/06 11:52:38 Yes it is. We need to discuss where to put the typ
+
+enum MediaStreamType {
+ kNoService = 0,
+ kAudioCapture,
+ kVideoCapture
+};
+
+enum MediaStreamProviderError {
+ kMediaStreamOk = 0,
+ kInvalidMediaStreamType,
+ kInvalidSession,
+ kUnknownSession,
+ kDeviceNotAvailable,
+ kDeviceAlreadyInUse,
+ kUnknownError
+};
+
+struct MediaCaptureDeviceInfo {
+ MediaStreamType stream_type;
+ std::string name;
+ std::string device_id;
+ bool in_use;
+
+ MediaCaptureDeviceInfo() : stream_type(kNoService), name(), device_id(),
+ in_use(false) {}
+ MediaCaptureDeviceInfo(MediaStreamType service_param,
+ const std::string name_param,
+ const std::string device_param,
+ bool opened)
+ : stream_type(service_param),
+ name(name_param),
+ device_id(device_param),
+ in_use(opened) {}
+};
+
+typedef std::list<MediaCaptureDeviceInfo> MediaCaptureDevices;
+
+// Feedback class
+class MediaStreamProviderListener {
wjia(left Chromium) 2011/05/06 00:11:31 Could you add comments on those API's?
mflodman1 2011/05/06 11:52:38 Done.
+ public:
+ virtual void Opened(MediaStreamType stream_type,
+ MediaCaptureSessionId capture_session_id) = 0;
+
+ virtual void Closed(MediaStreamType stream_type,
+ MediaCaptureSessionId capture_session_id) = 0;
+
+ virtual void DevicesEnumerated(MediaStreamType stream_type,
+ const MediaCaptureDevices& devices) = 0;
+
+ virtual void Error(MediaStreamType stream_type,
+ MediaCaptureSessionId capture_session_id,
+ MediaStreamProviderError error) = 0;
+
+ protected:
+ virtual ~MediaStreamProviderListener() {}
+};
+
+class MediaStreamProvider {
+ public:
+ virtual int Register(MediaStreamType service_type,
+ MediaStreamProviderListener* listener) = 0;
+
+ virtual void Unregister(MediaStreamType stream_type,
+ MediaStreamProviderListener* listener) = 0;
+
+ virtual void EnumerateDevices(MediaStreamType stream_type) = 0;
+
+ virtual MediaCaptureSessionId Open(MediaStreamType stream_type,
+ const MediaCaptureDeviceInfo& device) = 0;
+
+ virtual void Close(MediaStreamType stream_type,
+ MediaCaptureSessionId capture_session_id) = 0;
+
+ protected:
+ virtual ~MediaStreamProvider() {}
+};
wjia(left Chromium) 2011/05/06 00:11:31 one empty line here.
mflodman1 2011/05/06 11:52:38 Done.
+} // namespace media_stream
+
+#endif // CONTENT_BROWSER_MEDIA_STREAM_MEDIA_STREAM_PROVIDER_H_
mflodman1 2011/05/05 11:11:22 Will add newline in next upload
mflodman1 2011/05/06 11:52:38 Done.

Powered by Google App Engine
This is Rietveld 408576698