| 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 #ifndef CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 5 #ifndef CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
| 6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/common/media_stream_request.h" | 12 #include "content/public/common/media_stream_request.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 // Names for media stream source capture types. | 16 // Names for media stream source capture types. |
| 17 // These are values of the "TrackControls.stream_source" field, and are | 17 // These are values of the "TrackControls.stream_source" field, and are |
| 18 // set via the "chromeMediaSource" constraint. | 18 // set via the "chromeMediaSource" constraint. |
| 19 CONTENT_EXPORT extern const char kMediaStreamSourceTab[]; | 19 CONTENT_EXPORT extern const char kMediaStreamSourceTab[]; |
| 20 CONTENT_EXPORT extern const char kMediaStreamSourceScreen[]; | 20 CONTENT_EXPORT extern const char kMediaStreamSourceScreen[]; |
| 21 CONTENT_EXPORT extern const char kMediaStreamSourceDesktop[]; | 21 CONTENT_EXPORT extern const char kMediaStreamSourceDesktop[]; |
| 22 CONTENT_EXPORT extern const char kMediaStreamSourceSystem[]; | 22 CONTENT_EXPORT extern const char kMediaStreamSourceSystem[]; |
| 23 | 23 |
| 24 struct CONTENT_EXPORT TrackControls { | 24 struct CONTENT_EXPORT TrackControls { |
| 25 public: | 25 public: |
| 26 TrackControls(); | 26 TrackControls(); |
| 27 TrackControls(bool request); | 27 explicit TrackControls(bool request); |
| 28 TrackControls(const TrackControls& other); | 28 explicit TrackControls(const TrackControls& other); |
| 29 ~TrackControls(); | 29 ~TrackControls(); |
| 30 bool requested; | 30 bool requested; |
| 31 | 31 |
| 32 // Source. This is "tab", "screen", "desktop", "system", or blank. | 32 // Source. This is "tab", "screen", "desktop", "system", or blank. |
| 33 // Consider replacing with MediaStreamType enum variables. | 33 // Consider replacing with MediaStreamType enum variables. |
| 34 std::string stream_source; // audio.kMediaStreamSource | 34 std::string stream_source; // audio.kMediaStreamSource |
| 35 | 35 |
| 36 // Device ID requests. | 36 // Device ID requests. |
| 37 // The first set represents required devices - either grab one or fail. | 37 // The first set represents required devices - either grab one or fail. |
| 38 // The second set represents optional devices - if we can't get one of | 38 // The second set represents optional devices - if we can't get one of |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 struct CONTENT_EXPORT StreamDeviceInfo { | 64 struct CONTENT_EXPORT StreamDeviceInfo { |
| 65 static const int kNoId; | 65 static const int kNoId; |
| 66 | 66 |
| 67 StreamDeviceInfo(); | 67 StreamDeviceInfo(); |
| 68 StreamDeviceInfo(MediaStreamType service_param, | 68 StreamDeviceInfo(MediaStreamType service_param, |
| 69 const std::string& name_param, | 69 const std::string& name_param, |
| 70 const std::string& device_param); | 70 const std::string& device_param); |
| 71 StreamDeviceInfo(MediaStreamType service_param, | 71 StreamDeviceInfo(MediaStreamType service_param, |
| 72 const std::string& name_param, | 72 const std::string& name_param, |
| 73 const std::string& device_param, | 73 const std::string& device_param, |
| 74 const std::string& group_param); | |
| 75 StreamDeviceInfo(MediaStreamType service_param, | |
| 76 const std::string& name_param, | |
| 77 const std::string& device_param, | |
| 78 const std::string& group_param, | |
| 79 int sample_rate, | 74 int sample_rate, |
| 80 int channel_layout, | 75 int channel_layout, |
| 81 int frames_per_buffer); | 76 int frames_per_buffer); |
| 82 static bool IsEqual(const StreamDeviceInfo& first, | 77 static bool IsEqual(const StreamDeviceInfo& first, |
| 83 const StreamDeviceInfo& second); | 78 const StreamDeviceInfo& second); |
| 84 | 79 |
| 85 MediaStreamDevice device; | 80 MediaStreamDevice device; |
| 86 | 81 |
| 87 // Id for this capture session. Unique for all sessions of the same type. | 82 // Id for this capture session. Unique for all sessions of the same type. |
| 88 int session_id; | 83 int session_id; |
| 89 }; | 84 }; |
| 90 | 85 |
| 91 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; | 86 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; |
| 92 | 87 |
| 93 } // namespace content | 88 } // namespace content |
| 94 | 89 |
| 95 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 90 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
| OLD | NEW |