Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
a648f5f
commit 14238b4
Showing
10 changed files
with
454 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
Source/WebCore/platform/mediastream/MediaStreamComponent.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
84
Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.