OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // MediaStreamProvider is used to capture media of the types defined in | 5 // MediaStreamProvider is used to capture media of the types defined in |
6 // MediaStreamType. There is only one MediaStreamProvider instance per media | 6 // MediaStreamType. There is only one MediaStreamProvider instance per media |
7 // type and a MediaStreamProvider instance can have only one registered | 7 // type and a MediaStreamProvider instance can have only one registered |
8 // listener. | 8 // listener. |
9 // The MediaStreamManager is expected to be called on Browser::IO thread and | 9 // The MediaStreamManager is expected to be called on Browser::IO thread and |
10 // the listener will be called on the same thread. | 10 // the listener will be called on the same thread. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 }; | 51 }; |
52 | 52 |
53 // Implemented by a manager class providing captured media. | 53 // Implemented by a manager class providing captured media. |
54 class CONTENT_EXPORT MediaStreamProvider | 54 class CONTENT_EXPORT MediaStreamProvider |
55 : public base::RefCountedThreadSafe<MediaStreamProvider> { | 55 : public base::RefCountedThreadSafe<MediaStreamProvider> { |
56 public: | 56 public: |
57 // Registers a listener. | 57 // Registers a listener. |
58 virtual void RegisterListener(MediaStreamProviderListener* listener) = 0; | 58 virtual void RegisterListener(MediaStreamProviderListener* listener) = 0; |
59 | 59 |
60 // Unregisters a previously registered listener. | 60 // Unregisters a previously registered listener. |
61 virtual void UnregisterListener() = 0; | 61 virtual void UnregisterListener(MediaStreamProviderListener* listener) = 0; |
62 | 62 |
63 // Opens the specified device. The device is not started and it is still | 63 // Opens the specified device. The device is not started and it is still |
64 // possible for other applications to open the device before the device is | 64 // possible for other applications to open the device before the device is |
65 // started. |Opened| is called when the device is opened. | 65 // started. |Opened| is called when the device is opened. |
66 // kInvalidMediaCaptureSessionId is returned on error. | 66 // kInvalidMediaCaptureSessionId is returned on error. |
67 virtual int Open(const StreamDeviceInfo& device) = 0; | 67 virtual int Open(const MediaStreamDevice& device) = 0; |
68 | 68 |
69 // Closes the specified device and calls |Closed| when done. | 69 // Closes the specified device and calls |Closed| when done. |
70 virtual void Close(int capture_session_id) = 0; | 70 virtual void Close(int capture_session_id) = 0; |
71 | 71 |
72 protected: | 72 protected: |
73 friend class base::RefCountedThreadSafe<MediaStreamProvider>; | 73 friend class base::RefCountedThreadSafe<MediaStreamProvider>; |
74 virtual ~MediaStreamProvider() {} | 74 virtual ~MediaStreamProvider() {} |
75 }; | 75 }; |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
78 | 78 |
79 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_PROVIDER_H_ | 79 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_PROVIDER_H_ |
OLD | NEW |