<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[159971] trunk/Source/Platform</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/159971">159971</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-02 14:59:05 -0800 (Mon, 02 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Nix Upstream: Updating Platform files
https://bugs.webkit.org/show_bug.cgi?id=124982
Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-12-02
Reviewed by Benjamin Poulain.
Adding new Platform files that are missing in the trunk.
* PlatformNix.cmake:
* nix/public/AudioDestinationConsumer.h: Added.
(Nix::AudioDestinationConsumer::~AudioDestinationConsumer):
* nix/public/MediaConstraints.h: Added.
* nix/public/MediaStream.h: Added.
* nix/public/MediaStreamAudioSource.h: Added.
* nix/public/MediaStreamCenter.h: Added.
* nix/public/MediaStreamSource.h: Added.
* nix/public/PrivatePtr.h: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformChangeLog">trunk/Source/Platform/ChangeLog</a></li>
<li><a href="#trunkSourcePlatformPlatformNixcmake">trunk/Source/Platform/PlatformNix.cmake</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformnixpublicAudioDestinationConsumerh">trunk/Source/Platform/nix/public/AudioDestinationConsumer.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaConstraintsh">trunk/Source/Platform/nix/public/MediaConstraints.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamh">trunk/Source/Platform/nix/public/MediaStream.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamAudioSourceh">trunk/Source/Platform/nix/public/MediaStreamAudioSource.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamCenterh">trunk/Source/Platform/nix/public/MediaStreamCenter.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamSourceh">trunk/Source/Platform/nix/public/MediaStreamSource.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicPrivatePtrh">trunk/Source/Platform/nix/public/PrivatePtr.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourcePlatformChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/ChangeLog (159970 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/ChangeLog        2013-12-02 22:56:01 UTC (rev 159970)
+++ trunk/Source/Platform/ChangeLog        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2013-12-02 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
+
+ Nix Upstream: Updating Platform files
+ https://bugs.webkit.org/show_bug.cgi?id=124982
+
+ Reviewed by Benjamin Poulain.
+
+ Adding new Platform files that are missing in the trunk.
+
+ * PlatformNix.cmake:
+ * nix/public/AudioDestinationConsumer.h: Added.
+ (Nix::AudioDestinationConsumer::~AudioDestinationConsumer):
+ * nix/public/MediaConstraints.h: Added.
+ * nix/public/MediaStream.h: Added.
+ * nix/public/MediaStreamAudioSource.h: Added.
+ * nix/public/MediaStreamCenter.h: Added.
+ * nix/public/MediaStreamSource.h: Added.
+ * nix/public/PrivatePtr.h: Added.
+
</ins><span class="cx"> 2013-11-26 Marcelo Lira <marcelo.lira@openbossa.org>
</span><span class="cx">
</span><span class="cx"> Nix upstreaming - Adding build files and supporting scripts
</span></span></pre></div>
<a id="trunkSourcePlatformPlatformNixcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/PlatformNix.cmake (159970 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/PlatformNix.cmake        2013-12-02 22:56:01 UTC (rev 159970)
+++ trunk/Source/Platform/PlatformNix.cmake        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> set(Platform_HEADERS
</span><ins>+ nix/public/AudioDestinationConsumer.h
</ins><span class="cx"> nix/public/AudioDevice.h
</span><span class="cx"> nix/public/Canvas.h
</span><span class="cx"> nix/public/Color.h
</span><span class="lines">@@ -13,9 +14,15 @@
</span><span class="cx"> nix/public/FFTFrame.h
</span><span class="cx"> nix/public/Gamepad.h
</span><span class="cx"> nix/public/Gamepads.h
</span><ins>+ nix/public/MediaConstraints.h
</ins><span class="cx"> nix/public/MediaPlayer.h
</span><ins>+ nix/public/MediaStream.h
+ nix/public/MediaStreamAudioSource.h
+ nix/public/MediaStreamCenter.h
+ nix/public/MediaStreamSource.h
</ins><span class="cx"> nix/public/MultiChannelPCMData.h
</span><span class="cx"> nix/public/Platform.h
</span><ins>+ nix/public/PrivatePtr.h
</ins><span class="cx"> nix/public/Rect.h
</span><span class="cx"> nix/public/Size.h
</span><span class="cx"> nix/public/ThemeEngine.h
</span></span></pre></div>
<a id="trunkSourcePlatformnixpublicAudioDestinationConsumerh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/AudioDestinationConsumer.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/AudioDestinationConsumer.h         (rev 0)
+++ trunk/Source/Platform/nix/public/AudioDestinationConsumer.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_AudioDestinationConsumer_h
+#define Nix_AudioDestinationConsumer_h
+
+#include <cstddef>
+#include <vector>
+
+namespace Nix {
+
+class AudioDestinationConsumer {
+public:
+ virtual ~AudioDestinationConsumer() { }
+
+ virtual void setFormat(size_t numberOfChannels, float sampleRate) = 0;
+
+ // The size of the vector is the number of audio channels, and numberOfFrames is the
+ // number of audio frames in the (possibly multi-channel) buffer in a planar format.
+ virtual void consumeAudio(const std::vector<const float*>& pcmData, size_t numberOfFrames) = 0;
+};
+
+} // namespace Nix
+
+#endif // Nix_AudioDestinationConsumer_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaConstraintsh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaConstraints.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaConstraints.h         (rev 0)
+++ trunk/Source/Platform/nix/public/MediaConstraints.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaConstraints_h
+#define Nix_MediaConstraints_h
+
+#include "Common.h"
+#include "PrivatePtr.h"
+
+#include <cstddef>
+#include <string>
+#include <vector>
+
+namespace WebCore {
+struct MediaConstraint;
+class MediaConstraints;
+}
+
+namespace Nix {
+
+struct MediaConstraint {
+ MediaConstraint()
+ {
+ }
+
+ MediaConstraint(std::string name, std::string value)
+ : m_name(name)
+ , m_value(value)
+ {
+ }
+
+ std::string m_name;
+ std::string m_value;
+};
+
+class MediaConstraints {
+public:
+ MediaConstraints() { }
+ ~MediaConstraints() { reset(); }
+
+ void assign(const MediaConstraints&);
+
+ void reset();
+ NIX_EXPORT bool isNull() const { return m_private.isNull(); }
+
+ NIX_EXPORT void getMandatoryConstraints(std::vector<MediaConstraint>&) const;
+ NIX_EXPORT void getOptionalConstraints(std::vector<MediaConstraint>&) const;
+
+ NIX_EXPORT bool getMandatoryConstraintValue(const char* name, std::string& value) const;
+ NIX_EXPORT bool getOptionalConstraintValue(const char* name, std::string& value) const;
+
+#ifdef BUILDING_NIX__
+ MediaConstraints(const WTF::PassRefPtr<WebCore::MediaConstraints>&);
+ MediaConstraints(WebCore::MediaConstraints*);
+#endif
+
+private:
+ PrivatePtr<WebCore::MediaConstraints> m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaConstraints_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStream.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStream.h         (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStream.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_MediaStream_h
+#define Nix_MediaStream_h
+
+#include "Common.h"
+#include "PrivatePtr.h"
+
+#include <cstddef>
+#include <vector>
+
+namespace WebCore {
+class MediaStreamPrivate;
+}
+
+namespace Nix {
+
+class MediaStreamSource;
+class MediaStreamAudioSource;
+
+class MediaStream {
+public:
+ MediaStream() { }
+ MediaStream(const MediaStream& other) { assign(other); }
+ ~MediaStream() { reset(); }
+
+ MediaStream& operator=(const MediaStream& other)
+ {
+ assign(other);
+ return *this;
+ }
+
+ NIX_EXPORT void assign(const MediaStream&);
+
+ // Takes ownership of the MediaStreamSource* pointers, deleting them.
+ NIX_EXPORT void initialize(std::vector<MediaStreamSource*>& audioTracks, std::vector<MediaStreamSource*>& videoTracks);
+
+ NIX_EXPORT void reset();
+ NIX_EXPORT bool isNull() const;
+
+
+ NIX_EXPORT const char* id() const;
+
+ // Caller must delete the returned MediaStreamSource*
+ NIX_EXPORT std::vector<MediaStreamSource*> audioSources() const;
+ NIX_EXPORT std::vector<MediaStreamSource*> videoSources() const;
+
+ NIX_EXPORT void addSource(const MediaStreamSource&);
+ NIX_EXPORT void removeSource(const MediaStreamSource&);
+
+#if BUILDING_NIX__
+ MediaStream(WebCore::MediaStreamPrivate*);
+ MediaStream(const WTF::PassRefPtr<WebCore::MediaStreamPrivate>&);
+ operator WTF::PassRefPtr<WebCore::MediaStreamPrivate>() const;
+ operator WebCore::MediaStreamPrivate*() const;
+ MediaStream& operator=(const WTF::PassRefPtr<WebCore::MediaStreamPrivate>&);
+#endif
+
+private:
+ PrivatePtr<WebCore::MediaStreamPrivate> m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStream_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamAudioSourceh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamAudioSource.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamAudioSource.h         (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamAudioSource.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaStreamAudioSource_h
+#define Nix_MediaStreamAudioSource_h
+
+#include "Common.h"
+#include "MediaStreamSource.h"
+
+namespace WebCore {
+class MediaStreamAudioSource;
+}
+
+namespace Nix {
+class AudioDestinationConsumer;
+
+class MediaStreamAudioSource : public MediaStreamSource {
+public:
+ NIX_EXPORT MediaStreamAudioSource();
+ MediaStreamAudioSource(const MediaStreamAudioSource& other) : MediaStreamSource(other) { assign(other); }
+ ~MediaStreamAudioSource() { reset(); }
+
+ MediaStreamAudioSource& operator=(const MediaStreamAudioSource& other)
+ {
+ assign(other);
+ return *this;
+ }
+
+ NIX_EXPORT void assign(const MediaStreamAudioSource&);
+
+ NIX_EXPORT void reset();
+ bool isNull() const { return m_private.isNull(); }
+
+ NIX_EXPORT const char* deviceId() const;
+ NIX_EXPORT void setDeviceId(const char*);
+
+ // The Nix::AudioDestinationConsumer is not owned, and has to be disposed of separately
+ // after calling removeAudioConsumer.
+ NIX_EXPORT void addAudioConsumer(AudioDestinationConsumer*);
+ NIX_EXPORT bool removeAudioConsumer(AudioDestinationConsumer*);
+
+#if BUILDING_NIX__
+ MediaStreamAudioSource(const WTF::PassRefPtr<WebCore::MediaStreamAudioSource>&);
+ MediaStreamAudioSource& operator=(WebCore::MediaStreamAudioSource*);
+ operator WTF::PassRefPtr<WebCore::MediaStreamAudioSource>() const;
+ operator WebCore::MediaStreamAudioSource*() const;
+private:
+ WebCore::MediaStreamAudioSource* toWebCoreAudioSource() const;
+#endif
+
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamAudioSource_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamCenterh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamCenter.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamCenter.h         (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamCenter.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_MediaStreamCenter_h
+#define Nix_MediaStreamCenter_h
+
+#include "Common.h"
+#include "PrivatePtr.h"
+
+namespace WebCore {
+class MediaStreamCenter;
+}
+
+namespace Nix {
+class MediaStream;
+class MediaStreamSource;
+class MediaConstraints;
+
+class NIX_EXPORT MediaStreamCenter {
+public:
+ MediaStreamCenter();
+ void request();
+ // Return the name of the failed constraint. 0 if successful.
+ virtual const char* validateRequestConstraints(MediaConstraints& audioConstraints, MediaConstraints& videoConstraints) = 0;
+ virtual MediaStream createMediaStream(MediaConstraints& audioConstraints, MediaConstraints& videoConstraints) = 0;
+
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamCenter_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamSourceh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamSource.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamSource.h         (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamSource.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaStreamSource_h
+#define Nix_MediaStreamSource_h
+
+#include "Common.h"
+#include "PrivatePtr.h"
+
+namespace WebCore {
+class MediaStreamSource;
+}
+
+namespace Nix {
+
+class MediaStreamSource {
+public:
+
+ enum Type {
+ Audio,
+ Video
+ };
+
+ enum ReadyState {
+ ReadyStateLive = 0,
+ ReadyStateMuted = 1,
+ ReadyStateEnded = 2
+ };
+
+ MediaStreamSource() { }
+ MediaStreamSource(const MediaStreamSource& other) { assign(other); }
+ virtual ~MediaStreamSource() { reset(); }
+
+ MediaStreamSource& operator=(const MediaStreamSource& other)
+ {
+ assign(other);
+ return *this;
+ }
+
+ NIX_EXPORT void assign(const MediaStreamSource&);
+
+ NIX_EXPORT void reset();
+ bool isNull() const { return m_private.isNull(); }
+
+ NIX_EXPORT const char* id() const;
+ NIX_EXPORT Type type() const;
+ NIX_EXPORT const char* name() const;
+
+ NIX_EXPORT void setReadyState(ReadyState);
+ NIX_EXPORT ReadyState readyState() const;
+
+ NIX_EXPORT bool enabled() const;
+ NIX_EXPORT void setEnabled(bool);
+
+ NIX_EXPORT bool muted() const;
+ NIX_EXPORT void setMuted(bool);
+
+ NIX_EXPORT bool readonly() const;
+ NIX_EXPORT void setReadonly(bool);
+
+ // FIXME Add support for capabilites.
+
+#if BUILDING_NIX__
+ MediaStreamSource(const WTF::PassRefPtr<WebCore::MediaStreamSource>&);
+ MediaStreamSource& operator=(WebCore::MediaStreamSource*);
+ operator WTF::PassRefPtr<WebCore::MediaStreamSource>() const;
+ operator WebCore::MediaStreamSource*() const;
+#endif
+
+protected:
+ PrivatePtr<WebCore::MediaStreamSource> m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamSource_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicPrivatePtrh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/PrivatePtr.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/PrivatePtr.h         (rev 0)
+++ trunk/Source/Platform/nix/public/PrivatePtr.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. 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 Nix_PrivatePtr_h
+#define Nix_PrivatePtr_h
+
+#include "Common.h"
+
+#if BUILDING_NIX__
+#include <wtf/PassRefPtr.h>
+#endif
+
+#include <cassert>
+
+namespace Nix {
+
+// This class is an implementation detail of the Nix API. It exists
+// to help simplify the implementation of Nix interfaces that merely
+// wrap a reference counted WebCore class.
+template <typename T>
+class PrivatePtr {
+public:
+ PrivatePtr() : m_ptr(0) { }
+ ~PrivatePtr() { assert(!m_ptr); }
+
+ bool isNull() const { return !m_ptr; }
+
+#if BUILDING_NIX__
+ PrivatePtr(const PassRefPtr<T>& prp)
+ : m_ptr(prp.leakRef())
+ {
+ }
+
+ void reset()
+ {
+ assign(0);
+ }
+
+ PrivatePtr<T>& operator=(const PrivatePtr<T>& other)
+ {
+ T* p = other.m_ptr;
+ if (p)
+ p->ref();
+ assign(p);
+ return *this;
+ }
+
+ PrivatePtr<T>& operator=(const PassRefPtr<T>& prp)
+ {
+ assign(prp.leakRef());
+ return *this;
+ }
+
+ T* get() const
+ {
+ return m_ptr;
+ }
+
+ T* operator->() const
+ {
+ assert(m_ptr);
+ return m_ptr;
+ }
+
+private:
+ void assign(T* p)
+ {
+ // p is already ref'd for us by the caller
+ if (m_ptr)
+ m_ptr->deref();
+ m_ptr = p;
+ }
+#endif
+
+private:
+
+ T* m_ptr;
+};
+
+} // namespace Nix
+
+#endif // Nix_PrivatePtr_h
+
</ins></span></pre>
</div>
</div>
</body>
</html>