[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "initial_file_media_service" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 26 09:55:52 CDT 2011


branch "initial_file_media_service" has been created
        at  d8e97654c8976b623a8f613a795a11c6264bb398 (commit)

- Log -----------------------------------------------------------------
commit d8e97654c8976b623a8f613a795a11c6264bb398
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Sep 26 12:24:40 2011 -0230

    Moving this slice from the media service repo.

diff --git a/slice/AsteriskSCF/Media/File/FileMediaIf.ice b/slice/AsteriskSCF/Media/File/FileMediaIf.ice
new file mode 100644
index 0000000..24e695d
--- /dev/null
+++ b/slice/AsteriskSCF/Media/File/FileMediaIf.ice
@@ -0,0 +1,201 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+#include <AsteriskSCF/Media/MediaIf.ice>
+
+module AsteriskSCF
+{
+module Media
+{
+module File
+{
+module V1
+{
+
+const string ComponentCategory = "FileMediaService";
+const string DiscoveryCategory = "FileMediaService";
+
+/**
+ *
+ * Supported operations.
+ *
+ **/
+enum FileOperations
+{
+    Playback,
+    Recording,
+    Both
+};
+
+/**
+ *
+ * Specifications for required file media specification.
+ *
+ **/
+struct FileMediaSpecification
+{
+    /**
+     * 
+     * A sequence of formats that the File Media Service is expected to accept or produce. This is not used in the
+     * same manner as RTP when the media session is allocated. A file media session creates a source or sink for
+     * each format specified.
+     *
+     **/
+    AsteriskSCF::Media::V1::FormatSeq formats;
+   
+    /**
+     * 
+     * The supported file operations.
+     *
+     */
+    FileOperations supportedOperations;
+ 
+    /**
+     * 
+     * Media catalogue identifier. Most relevant to services providing playback. May simply be a filename.
+     *
+     **/
+    string catalogID;   
+};
+
+/** 
+ *  
+ * The service discovery parameters used for locating file media sessions that support particular
+ * options.
+ *
+ **/
+unsliceable class FileMediaServiceLocator extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+{
+    FileMediaSpecification mediaSpecification;
+};
+/**
+ * 
+ * Indicates that the specified file operation is not supported.
+ *
+ **/
+exception FileOperationNotAvailable
+{
+   string message;
+};
+ 
+/**
+ *
+ * Indicates that the file based session could not be allocated with the provided path.
+ *
+ **/
+exception PathNotAvailable
+{
+   string message;
+};
+ 
+/**
+ *
+ * Thrown if the specified catalog Id is not available.
+ *
+ **/
+exception UnknownCatalogID
+{
+   string catalogID;
+};
+ 
+/**
+ *
+ * The requested file session could not be allocated due to a resource being unavailable.
+ * The message data member contains a description of the error. These exceptions may be 
+ * thrown if the backing file is unavailable for some reason 
+ * (e.g. sharing violation, unavailable disk drive).
+ *
+ **/
+exception ResourceUnavailable
+{
+     string message;
+};
+
+/**
+ *
+ * A file media session that includes an accessor for a specification that should be somewhat
+ * related to the specification that was used to allocate it. It also defines a control interface
+ * for media consumption (in the case of recording) or playback.
+ *
+ **/
+interface FileSession extends AsteriskSCF::Media::V1::Session
+{
+    /**
+     *
+     * Obtain the specification for the file that backs this session.
+     *
+     */
+    FileMediaSpecification getInfo();
+
+    /**
+     * Start recording or playback on the Media Session's sinks and/or sources.
+     */
+    void start();
+    
+    /**
+     * Temporarily halt recording or playback.
+     **/
+    void pause();
+    
+    /**
+     * Resume recording and/or playback, starting at the point where pause() was called.
+     */
+    void unpause();
+    
+    /**
+     * Restart recording and/or playback at the beginning. If recording, previously 
+     * recorded data should be abandoned.
+     */
+    void restart();
+    
+    /**
+     * Halt recording and/or playback, destroy the object and release any resources 
+     * held on behalf of this object
+     */
+    void release();
+};
+ 
+/**
+ *
+ * The FileMediaService provides allocation services for File based media sessions.
+ *
+ **/
+interface FileMediaService
+{
+    /**
+     *
+     * Instantiate a file based session supporting the provided parameters.
+     *
+     **/
+    FileSession* create(FileMediaSpecification parameters) throws FileOperationNotAvailable, UnknownCatalogID, 
+        ResourceUnavailable;
+ 
+    /**
+     *
+     * Instantiate a file based session supporting the provided parameters, backed with a file residing at the
+     * specified file.
+     *
+     **/
+    FileSession* createWithPath(string path, FileMediaSpecification parameters)
+               throws FileOperationNotAvailable, UnknownCatalogID, PathNotAvailable, ResourceUnavailable;
+ 
+}; 
+    
+}; /* end of module V1 */
+}; /* end of module File */
+}; /* end of module Media */
+}; /* end of module AsteriskSCF */

commit 28ab66a1d742596f1b35030bf48e8b4a85a64b4a
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Sep 15 11:24:18 2011 -0230

    Add trace level to logging.

diff --git a/slice/AsteriskSCF/System/Logger/LoggerIf.ice b/slice/AsteriskSCF/System/Logger/LoggerIf.ice
index f793039..2fb8032 100644
--- a/slice/AsteriskSCF/System/Logger/LoggerIf.ice
+++ b/slice/AsteriskSCF/System/Logger/LoggerIf.ice
@@ -45,6 +45,8 @@ module Logging
     */
    enum Level
    {
+      /** Very verbose debugging messages (use with caution) */
+      Trace,
       /** debug-level messages */
       Debug,
       /** informational messages */
diff --git a/slice/AsteriskSCF/System/NAT/NATTraversalIf.ice b/slice/AsteriskSCF/System/NAT/NATTraversalIf.ice
index 46a206b..d5b66a1 100644
--- a/slice/AsteriskSCF/System/NAT/NATTraversalIf.ice
+++ b/slice/AsteriskSCF/System/NAT/NATTraversalIf.ice
@@ -256,14 +256,14 @@ class Candidate
 
     /**
      *
-     * The mapped address (note that this will be empty for host candidates.
+     * The mapped address (note that this will be empty for host candidates.)
      *
      **/
     string mappedAddress;
 
     /**
      * 
-     * The mapped port (note that this is only relevant if the mappedAddress is not empty.
+     * The mapped port (note that this is only relevant if the mappedAddress is not empty.)
      *
      **/
     int mappedPort;

commit f7a6cfa0ce860cca6407d11ddf57699f117467fe
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Sep 14 16:51:01 2011 -0500

    Merging changes to MediaRTPIf.ice

diff --git a/slice/AsteriskSCF/Media/RTP/MediaRTPIf.ice b/slice/AsteriskSCF/Media/RTP/MediaRTPIf.ice
index 5794b31..5b3584a 100644
--- a/slice/AsteriskSCF/Media/RTP/MediaRTPIf.ice
+++ b/slice/AsteriskSCF/Media/RTP/MediaRTPIf.ice
@@ -279,7 +279,7 @@ module V1
        * @throws SessionAllocationFailure if the media service is unable to allocate a session
        * to match the provided parameters.
        */
-       RTPSession* allocate(RTPServiceLocatorParams params) throws SessionAllocationFailure;
+       RTPSession* allocate(RTPServiceLocatorParams params, RTPOptions options, out RTPAllocationOutputs outputs) throws SessionAllocationFailure;
    };
 
 }; /*  end module V1 */

commit 66bcc079b7ec83fb484756c9da3d09d160ab1cbd
Merge: 08dce54 fde12f1
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Sep 14 16:50:47 2011 -0500

    Merge branch 'dtmf'
    
    Conflicts:
    	slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice


commit 08dce549dc9525de99a212081275b33e23d60b0b
Merge: ff44d0e 2f28b8f
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Sep 14 11:02:18 2011 -0500

    Merge branch 'media-operation'


commit ff44d0e1ff76a086e4851c15604cf9d1ba9ad3fc
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 21:21:19 2011 -0500

    Remove the decode and encode methods because they're dumb and won't work.

diff --git a/slice/AsteriskSCF/Media/MediaIf.ice b/slice/AsteriskSCF/Media/MediaIf.ice
index 4744446..6e5c7eb 100644
--- a/slice/AsteriskSCF/Media/MediaIf.ice
+++ b/slice/AsteriskSCF/Media/MediaIf.ice
@@ -481,22 +481,6 @@ module V1
          * @return bool True if compatible, false if not.
          */
         idempotent bool checkCompatible(Format format1, Format format2);
-
-        /**
-         * Method that decodes a frame payload from the network.
-         *
-         * @param toDecode Raw bytes from the network.
-         * @return An AsteriskSCF Frame payload that encapsulates the data
-         */
-        FramePayload decodePayload(Ice::ByteSeq toDecode);
-
-        /**
-         * Method that encodes a frame for the network to use.
-         *
-         * @param toDecode The frame payload to encode
-         * @return A byte sequence directly writeable to the network
-         */
-        Ice::ByteSeq encodePayload(FramePayload toEncode);
     };
 
     /**

commit ec6e9d9693aeb9935ba6665a10b81f2552349071
Merge: b7c0e57 767842b
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 14:08:17 2011 -0500

    Merge branch 'master' into resample
    
    Conflicts:
    	slice/AsteriskSCF/Media/Formats/AudioFormats.ice


commit 767842b03dab3430d585abb505eb7772753f60c3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 13:42:39 2011 -0500

    Squashed commit of the following:
    
    commit 2f28b8f7396b52bfd3a4298f65d798df599671a9
    Merge: 91f56f1 72ed2a9
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Tue Sep 13 12:01:56 2011 -0500
    
        Merge branch 'master' into media-operation
    
    commit 91f56f1e7a481e13a0b42d0fb1d323ac3ad3cb91
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Wed Aug 17 13:57:31 2011 -0500
    
        Add constants for locating media operations.
    
    commit ce9020326cff79fc41acb596241ff6641ea5af5f
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Wed Aug 17 13:38:58 2011 -0500
    
        Create a constant to use for the format names for ulaw and alaw.
    
    commit c1a96c506d66c71c874b2107c187bc5a28e8b4c3
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Mon Aug 15 11:56:45 2011 -0500
    
        Allow createMediaOperation to throw an exception if bad formats are given.
    
    commit 8e5e1f624b5fb5e498bb7d84a1172fa337e8bee3
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Thu Aug 11 17:24:01 2011 -0500
    
        Fix a typo.
    
    commit 1a56884ce4ac84e41ab64499a635834f6cd71f63
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Thu Aug 11 14:48:21 2011 -0500
    
        Return a proxy to a media operation.
    
    commit 990dd70ce8143d48a2064b0100f4f34a9ec1d344
    Author: Mark Michelson <mmichelson at digium.com>
    Date:   Thu Aug 11 14:05:48 2011 -0500
    
        Create slice definitions for media operations.

diff --git a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
index 349f1b7..645c427 100644
--- a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
+++ b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
@@ -46,6 +46,8 @@ module V1
          */
     };
 
+    const string G711uLAWName = "ulaw";
+
     /**
      * G.711 a-Law Audio Format
      */
@@ -56,6 +58,8 @@ module V1
          */
     };
 
+    const string G711aLAWName = "alaw";
+
 }; /*  end module V1 */
 
 }; /*  end module Audio */
diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
new file mode 100644
index 0000000..9dfcd96
--- /dev/null
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -0,0 +1,91 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <AsteriskSCF/Media/MediaIf.ice>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
+
+module AsteriskSCF
+{
+
+module Media
+{
+
+module V1
+{
+
+/**
+ * This is meant to be used in ServiceLocatorParams as the
+ * "category" for all media operations.
+ */
+const string MediaOperationDiscoveryCategory = "MediaOperation";
+
+/**
+ * This is Meant to be used in ServiceLocatorParams as the "service"
+ * when a translator is needed. The service set by media operations
+ * that do not perform translation may use a descriptive term for
+ * their service instead, like "pitch shifter" or "volume adjustment."
+ */
+const string MediaOperationDiscoveryTranslatorService = "Translator";
+
+interface MediaOperation
+{
+    StreamSource* getSource();
+    StreamSink* getSink();
+    void destroy();
+};
+
+interface MediaOperationFactory
+{
+    /**
+     * Create a new instance of a media operation.
+     * @param source optional source of media that will enter the operation
+     * @param sink optional source of media that the operation will write to
+     */
+    MediaOperation* createMediaOperation(
+            StreamSource* source,
+            StreamSink* sink) throws UnsupportedMediaFormatException;
+};
+
+struct MediaOperationAttributes
+{
+    /**
+     * The input format for a specific operation
+     */
+    Format inputFormat;
+    /**
+     * The output format for a specific operation
+     */
+    Format outputFormat;
+    /**
+     * The cost of the operation.
+     * Lower cost indicates an "easier" translation,
+     * either because it is faster or uses fewer resources.
+     */
+    int cost;
+};
+
+sequence<MediaOperationAttributes> MediaOperationAttributesSeq;
+
+unsliceable class MediaOperationServiceLocatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+{
+    MediaOperationAttributesSeq attributes;
+};
+
+}; /* end module V1 */
+}; /* end module Media */
+}; /* end module AsteriskSCF */

commit 2f28b8f7396b52bfd3a4298f65d798df599671a9
Merge: 91f56f1 72ed2a9
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 12:01:56 2011 -0500

    Merge branch 'master' into media-operation


commit 72ed2a9023730c39c02999ae681bf591f3b3f574
Merge: b51c5c4 4728563
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 11:48:11 2011 -0500

    Merge branch 'replacement'


commit b7c0e575e27fb0575c3c3f23007444a35a4caca7
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 29 17:18:57 2011 -0500

    Add g722 format;

diff --git a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
index 026f406..9c08446 100644
--- a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
+++ b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
@@ -73,6 +73,15 @@ module V1
     const string SignedLinear8Name = "slin8";
     const string SignedLinear16Name = "slin16";
 
+    /**
+     * G.722 Audio format
+     */
+    unsliceable class G722 extends AsteriskSCF::Media::V1::AudioFormat
+    {
+    };
+
+    const string G722Name = "G722";
+
 }; /*  end module V1 */
 
 }; /*  end module Audio */

commit 47285632c983664f7cc3a5ef11dfaf0ae07887e0
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 29 14:15:03 2011 -0500

    Add boolean parameter to router's transfer operations.
    
    This makes it so that the session may either be replaced or not
    depending on which is desired.

diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index 1cea172..78ca6f4 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -684,21 +684,23 @@ module V1
            SourceTerminatedPreBridgingException, BridgingException ;
 
         /**
-         * Replace one session in a Bridge with a new
+         * Connect sessions bridged with one session with a new
          * session routable by the destination param.
-         *
-         * Note that the session to replace will not be removed
-         * from its bridge nor will it be stopped.
+         * The session specified may optionally be replaced.
          *
          * @param operationId Unique id for this operation.
          *
-         * @param sessionToReplace The session that is to be replaced in a
-         *   bridge. The bridge obejct is obtained from the accessor on this
+         * @param sessionToReplace The session whose bridged sessions are connected
+         *   with a newly created session. The bridge object is obtained from the accessor on this
          *   proxy.
          *
          * @param destination The identifier for the destination to be added to
          *   the bridge in place of sessionToReplace.
          *
+         * @param replaceSession If true, then sessionToReplace will be removed from the bridge
+         *   and shut down. If not, then new sessions will be added to sessionToReplace's bridge
+         *   without removing or shutting down sessionToReplace.
+         *
          * @throws DestinationNotFoundException if the given destination could not be found.
          *
          * @throws SessionCreationException if the destination endpoint could not create a session.
@@ -710,7 +712,11 @@ module V1
          * @throws NotBridged if the provided session is not currently in a bridge.
          */
         ["amd"]
-        void connectBridgedSessionsWithDestination(string operationId, Session* sessionToReplace, string destination,
+        void connectBridgedSessionsWithDestination(
+                string operationId,
+                Session* sessionToReplace,
+                string destination,
+                bool replaceSession,
                 AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHook* oneShotHook)
            throws AsteriskSCF::Core::Routing::V1::DestinationNotFoundException,
            SessionCreationException,
@@ -733,6 +739,10 @@ module V1
          *   their current bridge before being added to the bridge currenltly attached to
          *   sessionToReplace.
          *
+         * @param replaceSession If true, then sessionToReplace will be removed from its bridge
+         *   and shut down. If false, then sessions bridged to bridgedSession will be added to
+         *   sessionToReplace's bridge.
+         *
          * @throws SourceTerminatedPreBridgingException if the source session was terminated early.
          *
          * @throws BridgingException if the bridge could not be setup properly.
@@ -740,7 +750,11 @@ module V1
          * @throws NotBridged if the session provided in sessionToReplace is not currently in a bridge.
          */
         ["amd"]
-        void connectBridgedSessions(string operationId, Session* sessionToReplace, Session* bridgedSession)
+        void connectBridgedSessions(
+                string operationId,
+                Session* sessionToReplace,
+                Session* bridgedSession,
+                bool replaceSession)
            throws SourceTerminatedPreBridgingException, BridgingException, NotBridged ;
     };
 
@@ -964,8 +978,6 @@ module V1
         * Replaces a session that is on the bridge with another session. Useful for transfers, etc.
         * where a participant is replaced as part of the code flow.
         *
-        * Note that the session to replace is neither removed from the bridge nor stopped.
-        *
         * @param sessionToReplace The session being replaced. The bridge associated with this
         *   session is used for the newSessions.
         *

commit 0a0f8a476847b42dd3fa66576cfeed3591bc2169
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 29 12:39:13 2011 -0500

    Add documentation that explains that sessions replaced will not be unbridged or stopped.

diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index f3e92d8..1cea172 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -687,6 +687,9 @@ module V1
          * Replace one session in a Bridge with a new
          * session routable by the destination param.
          *
+         * Note that the session to replace will not be removed
+         * from its bridge nor will it be stopped.
+         *
          * @param operationId Unique id for this operation.
          *
          * @param sessionToReplace The session that is to be replaced in a
@@ -961,6 +964,8 @@ module V1
         * Replaces a session that is on the bridge with another session. Useful for transfers, etc.
         * where a participant is replaced as part of the code flow.
         *
+        * Note that the session to replace is neither removed from the bridge nor stopped.
+        *
         * @param sessionToReplace The session being replaced. The bridge associated with this
         *   session is used for the newSessions.
         *

commit 08371c40e29b89e72a3acdc051757ae15f3c78b4
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 23 17:28:59 2011 -0500

    Add signed linear format.

diff --git a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
index 645c427..026f406 100644
--- a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
+++ b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
@@ -60,6 +60,19 @@ module V1
 
     const string G711aLAWName = "alaw";
 
+    /**
+     * Signed linear Audio Format
+     */
+    unsliceable class SignedLinear extends AsteriskSCF::Media::V1::AudioFormat
+    {
+        /**
+         * Another basic class that requires no additional parameters
+         */
+    };
+
+    const string SignedLinear8Name = "slin8";
+    const string SignedLinear16Name = "slin16";
+
 }; /*  end module V1 */
 
 }; /*  end module Audio */

commit 953289a66556d717384244c36f73acc945562099
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 22 15:24:20 2011 -0500

    Add some more format operations services for convenience.

diff --git a/slice/AsteriskSCF/Media/MediaIf.ice b/slice/AsteriskSCF/Media/MediaIf.ice
index f9bb522..97e512c 100644
--- a/slice/AsteriskSCF/Media/MediaIf.ice
+++ b/slice/AsteriskSCF/Media/MediaIf.ice
@@ -339,6 +339,33 @@ module V1
     };
 
     /**
+     * Represents the payload of a media frame.
+     */
+    class FramePayload
+    {
+    };
+
+    /**
+     * A payload represented as a byte sequence.
+     * This is useful for formats whose payload consists
+     * of bytes, such as the G711 audio formats.
+     */
+    class ByteSeqPayload extends FramePayload
+    {
+        Ice::ByteSeq payload;
+    };
+
+    /**
+     * A payload represented as a sequence of 16-bit quantities.
+     * This is useful for formats whose payload consists
+     * of 16-bit quantities, such as signed linear audio.
+     */
+    class ShortSeqPayload extends FramePayload
+    {
+        Ice::ShortSeq payload;
+    };
+
+    /**
      * A generic frame class that contains common details about frames. Additional classes should extend this to provide
      * additional details about the frame.
      */
@@ -350,9 +377,9 @@ module V1
         Format mediaFormat;
 
         /**
-         * A sequence of bytes which contain the actual data payload of this frame.
+         * The payload of the frame.
          */
-        Ice::ByteSeq payload;
+        FramePayload payload;
     };
 
     /**
@@ -400,6 +427,22 @@ module V1
          * @return bool True if compatible, false if not.
          */
         idempotent bool checkCompatible(Format format1, Format format2);
+
+        /**
+         * Method that decodes a frame payload from the network.
+         *
+         * @param toDecode Raw bytes from the network.
+         * @return An AsteriskSCF Frame payload that encapsulates the data
+         */
+        FramePayload decodePayload(Ice::ByteSeq toDecode);
+
+        /**
+         * Method that encodes a frame for the network to use.
+         *
+         * @param toDecode The frame payload to encode
+         * @return A byte sequence directly writeable to the network
+         */
+        Ice::ByteSeq encodePayload(FramePayload toEncode);
     };
 
     /**
@@ -428,6 +471,11 @@ module V1
     class AudioFormat extends Format
     {
         /**
+         * Numerical sample size in bits
+         */
+        int sampleSize;
+
+        /**
          * Numerical sample rate specified in Hz.
          */
         int sampleRate;

commit 91f56f1e7a481e13a0b42d0fb1d323ac3ad3cb91
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Aug 17 13:57:31 2011 -0500

    Add constants for locating media operations.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index e7dfe95..9dfcd96 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -28,6 +28,20 @@ module Media
 module V1
 {
 
+/**
+ * This is meant to be used in ServiceLocatorParams as the
+ * "category" for all media operations.
+ */
+const string MediaOperationDiscoveryCategory = "MediaOperation";
+
+/**
+ * This is Meant to be used in ServiceLocatorParams as the "service"
+ * when a translator is needed. The service set by media operations
+ * that do not perform translation may use a descriptive term for
+ * their service instead, like "pitch shifter" or "volume adjustment."
+ */
+const string MediaOperationDiscoveryTranslatorService = "Translator";
+
 interface MediaOperation
 {
     StreamSource* getSource();

commit ce9020326cff79fc41acb596241ff6641ea5af5f
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Aug 17 13:38:58 2011 -0500

    Create a constant to use for the format names for ulaw and alaw.

diff --git a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
index 349f1b7..645c427 100644
--- a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
+++ b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
@@ -46,6 +46,8 @@ module V1
          */
     };
 
+    const string G711uLAWName = "ulaw";
+
     /**
      * G.711 a-Law Audio Format
      */
@@ -56,6 +58,8 @@ module V1
          */
     };
 
+    const string G711aLAWName = "alaw";
+
 }; /*  end module V1 */
 
 }; /*  end module Audio */

commit c1a96c506d66c71c874b2107c187bc5a28e8b4c3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 15 11:56:45 2011 -0500

    Allow createMediaOperation to throw an exception if bad formats are given.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 05eae31..e7dfe95 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -44,7 +44,7 @@ interface MediaOperationFactory
      */
     MediaOperation* createMediaOperation(
             StreamSource* source,
-            StreamSink* sink);
+            StreamSink* sink) throws UnsupportedMediaFormatException;
 };
 
 struct MediaOperationAttributes

commit 8e5e1f624b5fb5e498bb7d84a1172fa337e8bee3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 17:24:01 2011 -0500

    Fix a typo.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 5e42c8c..05eae31 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -44,7 +44,7 @@ interface MediaOperationFactory
      */
     MediaOperation* createMediaOperation(
             StreamSource* source,
-            StreamSource* sink);
+            StreamSink* sink);
 };
 
 struct MediaOperationAttributes

commit 1a56884ce4ac84e41ab64499a635834f6cd71f63
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 14:48:21 2011 -0500

    Return a proxy to a media operation.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 3c50a68..5e42c8c 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -42,7 +42,7 @@ interface MediaOperationFactory
      * @param source optional source of media that will enter the operation
      * @param sink optional source of media that the operation will write to
      */
-    MediaOperation createMediaOperation(
+    MediaOperation* createMediaOperation(
             StreamSource* source,
             StreamSource* sink);
 };

commit 990dd70ce8143d48a2064b0100f4f34a9ec1d344
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 14:05:48 2011 -0500

    Create slice definitions for media operations.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
new file mode 100644
index 0000000..3c50a68
--- /dev/null
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -0,0 +1,77 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <AsteriskSCF/Media/MediaIf.ice>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
+
+module AsteriskSCF
+{
+
+module Media
+{
+
+module V1
+{
+
+interface MediaOperation
+{
+    StreamSource* getSource();
+    StreamSink* getSink();
+    void destroy();
+};
+
+interface MediaOperationFactory
+{
+    /**
+     * Create a new instance of a media operation.
+     * @param source optional source of media that will enter the operation
+     * @param sink optional source of media that the operation will write to
+     */
+    MediaOperation createMediaOperation(
+            StreamSource* source,
+            StreamSource* sink);
+};
+
+struct MediaOperationAttributes
+{
+    /**
+     * The input format for a specific operation
+     */
+    Format inputFormat;
+    /**
+     * The output format for a specific operation
+     */
+    Format outputFormat;
+    /**
+     * The cost of the operation.
+     * Lower cost indicates an "easier" translation,
+     * either because it is faster or uses fewer resources.
+     */
+    int cost;
+};
+
+sequence<MediaOperationAttributes> MediaOperationAttributesSeq;
+
+unsliceable class MediaOperationServiceLocatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+{
+    MediaOperationAttributesSeq attributes;
+};
+
+}; /* end module V1 */
+}; /* end module Media */
+}; /* end module AsteriskSCF */

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/slice.git



More information about the asterisk-scf-commits mailing list