Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add WebCore platform interfaces needed by updated PeerConnection design
https://bugs.webkit.org/show_bug.cgi?id=68460

Patch by Adam Bergkvist <adam.bergkvist@ericsson.com> on 2011-10-07
Reviewed by Adam Barth.

Added the PeerConnection platform files to WebCore/platform/mediastream

Currently not testable.

* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* platform/mediastream/MediaStreamComponent.h: Added.
(WebCore::MediaStreamComponent::create):
(WebCore::MediaStreamComponent::source):
(WebCore::MediaStreamComponent::enabled):
(WebCore::MediaStreamComponent::setEnabled):
(WebCore::MediaStreamComponent::MediaStreamComponent):
* platform/mediastream/MediaStreamDescriptor.h: Added.
(WebCore::MediaStreamDescriptor::create):
(WebCore::MediaStreamDescriptor::owner):
(WebCore::MediaStreamDescriptor::setOwner):
(WebCore::MediaStreamDescriptor::label):
(WebCore::MediaStreamDescriptor::component):
(WebCore::MediaStreamDescriptor::numberOfComponents):
(WebCore::MediaStreamDescriptor::ended):
(WebCore::MediaStreamDescriptor::setEnded):
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
* platform/mediastream/MediaStreamSource.h: Added.
(WebCore::MediaStreamSource::create):
(WebCore::MediaStreamSource::id):
(WebCore::MediaStreamSource::type):
(WebCore::MediaStreamSource::name):
(WebCore::MediaStreamSource::muted):
(WebCore::MediaStreamSource::setMuted):
(WebCore::MediaStreamSource::MediaStreamSource):
* platform/mediastream/PeerHandler.cpp: Added.
(WebCore::PeerHandler::PeerHandler):
(WebCore::PeerHandler::~PeerHandler):
(WebCore::PeerHandler::produceInitialOffer):
(WebCore::PeerHandler::handleInitialOffer):
(WebCore::PeerHandler::processSDP):
(WebCore::PeerHandler::processPendingStreams):
(WebCore::PeerHandler::sendDataStreamMessage):
(WebCore::PeerHandler::stop):
* platform/mediastream/PeerHandler.h: Added.
(WebCore::PeerHandlerClient::~PeerHandlerClient):
(WebCore::PeerHandler::create):

Canonical link: https://commits.webkit.org/85709@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
adam-be authored and webkit-commit-queue committed Oct 7, 2011
1 parent a648f5f commit 14238b4
Show file tree
Hide file tree
Showing 10 changed files with 454 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,55 @@
2011-10-07 Adam Bergkvist <adam.bergkvist@ericsson.com>

Add WebCore platform interfaces needed by updated PeerConnection design
https://bugs.webkit.org/show_bug.cgi?id=68460

Reviewed by Adam Barth.

Added the PeerConnection platform files to WebCore/platform/mediastream

Currently not testable.

* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* platform/mediastream/MediaStreamComponent.h: Added.
(WebCore::MediaStreamComponent::create):
(WebCore::MediaStreamComponent::source):
(WebCore::MediaStreamComponent::enabled):
(WebCore::MediaStreamComponent::setEnabled):
(WebCore::MediaStreamComponent::MediaStreamComponent):
* platform/mediastream/MediaStreamDescriptor.h: Added.
(WebCore::MediaStreamDescriptor::create):
(WebCore::MediaStreamDescriptor::owner):
(WebCore::MediaStreamDescriptor::setOwner):
(WebCore::MediaStreamDescriptor::label):
(WebCore::MediaStreamDescriptor::component):
(WebCore::MediaStreamDescriptor::numberOfComponents):
(WebCore::MediaStreamDescriptor::ended):
(WebCore::MediaStreamDescriptor::setEnded):
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
* platform/mediastream/MediaStreamSource.h: Added.
(WebCore::MediaStreamSource::create):
(WebCore::MediaStreamSource::id):
(WebCore::MediaStreamSource::type):
(WebCore::MediaStreamSource::name):
(WebCore::MediaStreamSource::muted):
(WebCore::MediaStreamSource::setMuted):
(WebCore::MediaStreamSource::MediaStreamSource):
* platform/mediastream/PeerHandler.cpp: Added.
(WebCore::PeerHandler::PeerHandler):
(WebCore::PeerHandler::~PeerHandler):
(WebCore::PeerHandler::produceInitialOffer):
(WebCore::PeerHandler::handleInitialOffer):
(WebCore::PeerHandler::processSDP):
(WebCore::PeerHandler::processPendingStreams):
(WebCore::PeerHandler::sendDataStreamMessage):
(WebCore::PeerHandler::stop):
* platform/mediastream/PeerHandler.h: Added.
(WebCore::PeerHandlerClient::~PeerHandlerClient):
(WebCore::PeerHandler::create):

2011-10-07 Vineet Chaudary <vineet.chaudhary@motorola.com>

background-color affects the font color in disabled textarea.
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/GNUmakefile.am
Expand Up @@ -60,6 +60,7 @@ webcore_cppflags += \
-I$(srcdir)/Source/WebCore/platform/image-decoders/webp \
-I$(srcdir)/Source/WebCore/platform/image-decoders/png \
-I$(srcdir)/Source/WebCore/platform/leveldb \
-I$(srcdir)/Source/WebCore/platform/mediastream \
-I$(srcdir)/Source/WebCore/platform/mock \
-I$(srcdir)/Source/WebCore/platform/network \
-I$(srcdir)/Source/WebCore/platform/sql \
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/GNUmakefile.list.am
Expand Up @@ -2695,6 +2695,11 @@ webcore_sources += \
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h \
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \
Source/WebCore/platform/mediastream/MediaStreamComponent.h \
Source/WebCore/platform/mediastream/MediaStreamDescriptor.h \
Source/WebCore/platform/mediastream/MediaStreamSource.h \
Source/WebCore/platform/mediastream/PeerHandler.cpp \
Source/WebCore/platform/mediastream/PeerHandler.h \
Source/WebCore/platform/mock/DeviceOrientationClientMock.cpp \
Source/WebCore/platform/mock/DeviceOrientationClientMock.h \
Source/WebCore/platform/mock/GeolocationClientMock.cpp \
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/WebCore.gyp/WebCore.gyp
Expand Up @@ -193,6 +193,7 @@
'../platform/image-decoders/webp',
'../platform/image-encoders/skia',
'../platform/leveldb',
'../platform/mediastream',
'../platform/mock',
'../platform/network',
'../platform/network/chromium',
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/WebCore.gypi
Expand Up @@ -810,6 +810,11 @@
'platform/mac/WebCoreSystemInterface.h',
'platform/mac/WebCoreView.h',
'platform/mac/WebFontCache.h',
'platform/mediastream/MediaStreamComponent.h',
'platform/mediastream/MediaStreamDescriptor.h',
'platform/mediastream/MediaStreamSource.h',
'platform/mediastream/PeerHandler.cpp',
'platform/mediastream/PeerHandler.h',
'platform/mock/DeviceOrientationClientMock.h',
'platform/mock/GeolocationClientMock.h',
'platform/network/AuthenticationChallengeBase.h',
Expand Down
67 changes: 67 additions & 0 deletions Source/WebCore/platform/mediastream/MediaStreamComponent.h
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2011 Ericsson AB. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Ericsson nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MediaStreamComponent_h
#define MediaStreamComponent_h

#if ENABLE(MEDIA_STREAM)

#include "MediaStreamSource.h"

namespace WebCore {

class MediaStreamComponent : public RefCounted<MediaStreamComponent> {
public:
static PassRefPtr<MediaStreamComponent> create(PassRefPtr<MediaStreamSource> source)
{
return adoptRef(new MediaStreamComponent(source));
}

MediaStreamSource* source() const { return m_source.get(); }

bool enabled() const { return m_enabled; }
void setEnabled(bool enabled) { m_enabled = enabled; }

private:
MediaStreamComponent(PassRefPtr<MediaStreamSource> source)
: m_source(source)
, m_enabled(true)
{
}

RefPtr<MediaStreamSource> m_source;
bool m_enabled;
};

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM)

#endif // MediaStreamComponent_h
84 changes: 84 additions & 0 deletions Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
@@ -0,0 +1,84 @@
/*
* Copyright (C) 2011 Ericsson AB. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Ericsson nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MediaStreamDescriptor_h
#define MediaStreamDescriptor_h

#if ENABLE(MEDIA_STREAM)

#include "MediaStreamComponent.h"
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>

namespace WebCore {

class MediaStream;

class MediaStreamDescriptor : public RefCounted<MediaStreamDescriptor> {
public:
static PassRefPtr<MediaStreamDescriptor> create(const String& label, const MediaStreamSourceVector& sources)
{
return adoptRef(new MediaStreamDescriptor(label, sources));
}

MediaStream* owner() const { return m_owner; }
void setOwner(MediaStream* owner) { m_owner = owner; }

String label() const { return m_label; }

MediaStreamComponent* component(unsigned index) const { return m_components[index].get(); }
unsigned numberOfComponents() const { return m_components.size(); }

bool ended() const { return m_ended; }
void setEnded() { m_ended = true; }

private:
MediaStreamDescriptor(const String& label, const MediaStreamSourceVector& sources)
: m_owner(0)
, m_label(label)
, m_ended(false)
{
for (size_t i = 0; i < sources.size(); i++)
m_components.append(MediaStreamComponent::create(sources[i]));
}

MediaStream* m_owner;
String m_label;
Vector<RefPtr<MediaStreamComponent> > m_components;
bool m_ended;
};

typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector;

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM)

#endif // MediaStreamDescriptor_h
82 changes: 82 additions & 0 deletions Source/WebCore/platform/mediastream/MediaStreamSource.h
@@ -0,0 +1,82 @@
/*
* Copyright (C) 2011 Ericsson AB. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Ericsson nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MediaStreamSource_h
#define MediaStreamSource_h

#if ENABLE(MEDIA_STREAM)

#include "PlatformString.h"
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>

namespace WebCore {

class MediaStreamSource : public RefCounted<MediaStreamSource> {
public:
enum Type {
TypeAudio,
TypeVideo
};

static PassRefPtr<MediaStreamSource> create(const String& id, Type type, const String& name)
{
return adoptRef(new MediaStreamSource(id, type, name));
}

const String& id() const { return m_id; }
Type type() const { return m_type; }
const String& name() const { return m_name; }

bool muted() const { return m_muted; }
void setMuted(bool muted) { m_muted = muted; }

private:
MediaStreamSource(const String& id, Type type, const String& name)
: m_id(id)
, m_type(type)
, m_name(name)
, m_muted(false)
{
}

String m_id;
Type m_type;
String m_name;
bool m_muted;
};

typedef Vector<RefPtr<MediaStreamSource> > MediaStreamSourceVector;

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM)

#endif // MediaStreamSource_h

0 comments on commit 14238b4

Please sign in to comment.