summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp')
-rw-r--r--Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
index dc445a51a..425681805 100644
--- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
@@ -30,6 +30,8 @@
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
#include "HostWindow.h"
+#include "MediaStreamDescriptor.h"
+#include "MediaStreamRegistry.h"
#include "NotImplemented.h"
#include "PlatformContextSkia.h"
#include "ProtectionSpace.h"
@@ -783,6 +785,33 @@ int MediaPlayerPrivate::showErrorDialog(PlatformPlayer::Error type)
return rc;
}
+static WebMediaStreamSource toWebMediaStreamSource(MediaStreamSource* src)
+{
+ return WebMediaStreamSource(src->id().utf8().data(), static_cast<WebMediaStreamSource::Type>(src->type()), src->name().utf8().data());
+}
+
+static WebMediaStreamDescriptor toWebMediaStreamDescriptor(MediaStreamDescriptor* d)
+{
+ vector<WebMediaStreamSource> audioSources;
+ for (size_t i = 0; i < d->numberOfAudioComponents(); i++)
+ audioSources.push_back(toWebMediaStreamSource(d->audioComponent(i)->source()));
+
+ vector<WebMediaStreamSource> videoSources;
+ for (size_t i = 0; i < d->numberOfVideoComponents(); i++)
+ videoSources.push_back(toWebMediaStreamSource(d->videoComponent(i)->source()));
+
+ return WebMediaStreamDescriptor(d->label().utf8().data(), audioSources, videoSources);
+}
+
+WebMediaStreamDescriptor MediaPlayerPrivate::lookupMediaStream(const string& url)
+{
+ MediaStreamDescriptor* descriptor = MediaStreamRegistry::registry().lookupMediaStreamDescriptor(String::fromUTF8(url.c_str()));
+ if (!descriptor)
+ return WebMediaStreamDescriptor();
+
+ return toWebMediaStreamDescriptor(descriptor);
+}
+
FrameView* MediaPlayerPrivate::frameView() const
{
// We previously used m_webCorePlayer->frameView(), but this method returns