OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 typedef base::Callback<void(MediaStreamSource* source, | 27 typedef base::Callback<void(MediaStreamSource* source, |
28 bool success)> ConstraintsCallback; | 28 bool success)> ConstraintsCallback; |
29 | 29 |
30 MediaStreamSource(); | 30 MediaStreamSource(); |
31 virtual ~MediaStreamSource(); | 31 virtual ~MediaStreamSource(); |
32 | 32 |
33 virtual void AddTrack(const blink::WebMediaStreamTrack& track, | 33 virtual void AddTrack(const blink::WebMediaStreamTrack& track, |
34 const blink::WebMediaConstraints& constraints, | 34 const blink::WebMediaConstraints& constraints, |
35 const ConstraintsCallback& callback) = 0; | 35 const ConstraintsCallback& callback) = 0; |
36 virtual void RemoveTrack(const blink::WebMediaStreamTrack& track) = 0; | |
37 | 36 |
38 // Returns device information about a source that has been created by a | 37 // Returns device information about a source that has been created by a |
39 // JavaScript call to GetUserMedia, e.g., a camera or microphone. | 38 // JavaScript call to GetUserMedia, e.g., a camera or microphone. |
40 const StreamDeviceInfo& device_info() const { | 39 const StreamDeviceInfo& device_info() const { |
41 return device_info_; | 40 return device_info_; |
42 } | 41 } |
43 | 42 |
44 // Stops the source (by calling DoStopSource()). This sets the | 43 // Stops the source (by calling DoStopSource()). This sets the |
45 // WebMediaStreamSource::readyState to ended, triggers the |stop_callback_| | 44 // WebMediaStreamSource::readyState to ended, triggers the |stop_callback_| |
46 // if set. All pointers to this object are invalid after calling this. | 45 // if set. All pointers to this object are invalid after calling this. |
(...skipping 24 matching lines...) Expand all Loading... |
71 private: | 70 private: |
72 StreamDeviceInfo device_info_; | 71 StreamDeviceInfo device_info_; |
73 SourceStoppedCallback stop_callback_; | 72 SourceStoppedCallback stop_callback_; |
74 | 73 |
75 DISALLOW_COPY_AND_ASSIGN(MediaStreamSource); | 74 DISALLOW_COPY_AND_ASSIGN(MediaStreamSource); |
76 }; | 75 }; |
77 | 76 |
78 } // namespace content | 77 } // namespace content |
79 | 78 |
80 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ | 79 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ |
OLD | NEW |