| 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 27 matching lines...) Expand all Loading... |
| 38 // JavaScript call to GetUserMedia, e.g., a camera or microphone. | 38 // JavaScript call to GetUserMedia, e.g., a camera or microphone. |
| 39 const StreamDeviceInfo& device_info() const { | 39 const StreamDeviceInfo& device_info() const { |
| 40 return device_info_; | 40 return device_info_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Stops the source (by calling DoStopSource()). This runs the | 43 // Stops the source (by calling DoStopSource()). This runs the |
| 44 // |stop_callback_| (if set), and then sets the | 44 // |stop_callback_| (if set), and then sets the |
| 45 // WebMediaStreamSource::readyState to ended. | 45 // WebMediaStreamSource::readyState to ended. |
| 46 void StopSource(); | 46 void StopSource(); |
| 47 | 47 |
| 48 // Sets the source's state to muted or to live. |
| 49 void SetSourceMuted(bool is_muted); |
| 50 |
| 48 // Sets device information about a source that has been created by a | 51 // Sets device information about a source that has been created by a |
| 49 // JavaScript call to GetUserMedia. F.E a camera or microphone. | 52 // JavaScript call to GetUserMedia. F.E a camera or microphone. |
| 50 void SetDeviceInfo(const StreamDeviceInfo& device_info); | 53 void SetDeviceInfo(const StreamDeviceInfo& device_info); |
| 51 | 54 |
| 52 // Sets a callback that will be triggered when StopSource is called. | 55 // Sets a callback that will be triggered when StopSource is called. |
| 53 void SetStopCallback(const SourceStoppedCallback& stop_callback); | 56 void SetStopCallback(const SourceStoppedCallback& stop_callback); |
| 54 | 57 |
| 55 // Clears the previously-set SourceStoppedCallback so that it will not be run | 58 // Clears the previously-set SourceStoppedCallback so that it will not be run |
| 56 // in the future. | 59 // in the future. |
| 57 void ResetSourceStoppedCallback(); | 60 void ResetSourceStoppedCallback(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 68 // In debug builds, check that all methods are being called on the main | 71 // In debug builds, check that all methods are being called on the main |
| 69 // thread. | 72 // thread. |
| 70 base::ThreadChecker thread_checker_; | 73 base::ThreadChecker thread_checker_; |
| 71 | 74 |
| 72 DISALLOW_COPY_AND_ASSIGN(MediaStreamSource); | 75 DISALLOW_COPY_AND_ASSIGN(MediaStreamSource); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace content | 78 } // namespace content |
| 76 | 79 |
| 77 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ | 80 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_ |
| OLD | NEW |