| Index: Source/modules/mediastream/MediaDeviceInfo.cpp
|
| diff --git a/Source/modules/mediastream/SourceInfo.cpp b/Source/modules/mediastream/MediaDeviceInfo.cpp
|
| similarity index 58%
|
| copy from Source/modules/mediastream/SourceInfo.cpp
|
| copy to Source/modules/mediastream/MediaDeviceInfo.cpp
|
| index be8dfc2561a19fb076c8ae6180ce5c45f5e49265..5182e59cebf2956f1d31d33b614e980164490ef6 100644
|
| --- a/Source/modules/mediastream/SourceInfo.cpp
|
| +++ b/Source/modules/mediastream/MediaDeviceInfo.cpp
|
| @@ -24,62 +24,52 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "modules/mediastream/SourceInfo.h"
|
| +#include "modules/mediastream/MediaDeviceInfo.h"
|
|
|
| #include "wtf/text/WTFString.h"
|
|
|
| namespace WebCore {
|
|
|
| -PassRefPtr<SourceInfo> SourceInfo::create(const blink::WebSourceInfo& webSourceInfo)
|
| +PassRefPtr<MediaDeviceInfo> MediaDeviceInfo::create(const blink::WebMediaDeviceInfo& webMediaDeviceInfo)
|
| {
|
| - ASSERT(!webSourceInfo.isNull());
|
| - return adoptRef(new SourceInfo(webSourceInfo));
|
| + ASSERT(!webMediaDeviceInfo.isNull());
|
| + return adoptRef(new MediaDeviceInfo(webMediaDeviceInfo));
|
| }
|
|
|
| -SourceInfo::SourceInfo(const blink::WebSourceInfo& webSourceInfo)
|
| - : m_webSourceInfo(webSourceInfo)
|
| +MediaDeviceInfo::MediaDeviceInfo(const blink::WebMediaDeviceInfo& webMediaDeviceInfo)
|
| + : m_webMediaDeviceInfo(webMediaDeviceInfo)
|
| {
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| -String SourceInfo::id() const
|
| +String MediaDeviceInfo::deviceId() const
|
| {
|
| - return m_webSourceInfo.id();
|
| + return m_webMediaDeviceInfo.deviceId();
|
| }
|
|
|
| -String SourceInfo::kind() const
|
| +String MediaDeviceInfo::kind() const
|
| {
|
| - switch (m_webSourceInfo.kind()) {
|
| - case blink::WebSourceInfo::SourceKindAudio:
|
| - return "audio";
|
| - case blink::WebSourceInfo::SourceKindVideo:
|
| - return "video";
|
| - case blink::WebSourceInfo::SourceKindNone:
|
| - return "none";
|
| + switch (m_webMediaDeviceInfo.kind()) {
|
| + case blink::WebMediaDeviceInfo::MediaDeviceKindAudioInput:
|
| + return "audioinput";
|
| + case blink::WebMediaDeviceInfo::MediaDeviceKindAudioOutput:
|
| + return "audiooutput";
|
| + case blink::WebMediaDeviceInfo::MediaDeviceKindVideoInput:
|
| + return "videoinput";
|
| }
|
|
|
| ASSERT_NOT_REACHED();
|
| return String();
|
| }
|
|
|
| -String SourceInfo::label() const
|
| +String MediaDeviceInfo::label() const
|
| {
|
| - return m_webSourceInfo.label();
|
| + return m_webMediaDeviceInfo.label();
|
| }
|
|
|
| -String SourceInfo::facing() const
|
| +String MediaDeviceInfo::groupId() const
|
| {
|
| - switch (m_webSourceInfo.facing()) {
|
| - case blink::WebSourceInfo::VideoFacingModeNone:
|
| - return String();
|
| - case blink::WebSourceInfo::VideoFacingModeUser:
|
| - return "user";
|
| - case blink::WebSourceInfo::VideoFacingModeEnvironment:
|
| - return "environment";
|
| - }
|
| -
|
| - ASSERT_NOT_REACHED();
|
| - return String();
|
| + return m_webMediaDeviceInfo.groupId();
|
| }
|
|
|
| } // namespace WebCore
|
|
|