[asterisk-scf-commits] asterisk-scf/integration/file_media_service.git branch "initial_development" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Sep 7 09:10:33 CDT 2011
branch "initial_development" has been created
at 3a8cdb202a77cac4fb1c298e72f0097fead59a8d (commit)
- Log -----------------------------------------------------------------
commit 3a8cdb202a77cac4fb1c298e72f0097fead59a8d
Author: Brent Eagles <beagles at digium.com>
Date: Tue Sep 6 12:12:52 2011 -0230
Initial files for file media service
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..7029935
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,11 @@
+#
+# File Media Service component.
+#
+
+astscf_project(FileMediaService 3.4)
+
+add_subdirectory(src)
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()
+astscf_slice_collection_install(PROJECT)
diff --git a/config/FileMediaService.config b/config/FileMediaService.config
new file mode 100755
index 0000000..ce71c1b
--- /dev/null
+++ b/config/FileMediaService.config
@@ -0,0 +1,68 @@
+#
+# Example configuration file for File Media Service
+#
+
+[general]
+root-directory=c:/data/asteriskscf/filemedia
+destination-prefix=sample.
+default-suffix=.mkv
+
+#
+# Each group will map to category id.
+#
+[hello-world]
+#
+# The filename does not necessarily need to be specified. If not specified
+# the service will attempt to load a file with the same name as this group.
+#
+filename=hello_world
+
+#
+# supported operations may be:
+# value | operation
+# -------------------
+# r read only
+# w write only
+# rw read write
+supported-operations=r
+
+[try-me]
+#
+# See above group... the filename will be defaulted to try-me.mkv
+# This is just a second group to illustrate the default name concept
+#
+# filename try-me.mkv
+supported-operations=r
+
+[this-is-a-recording]
+#
+# A read-write... if you specify write, it will record. If you specify read,
+# it will playback whatever was recorded last.
+#
+filename=test_recording
+supported-operations=rw
+
+#
+# Policy descriptor when receiving new media for recording. The supported
+# policies are:
+# value | description
+# ---------------------------------------
+# new-track add a new track to the container/repository
+# overwrite overwrite the existing recording container/repository
+# append start recording at the end of an existing recording/track
+#
+tracking=new-track
+
+#
+# Policy for making a file "unique" relative to what is being recorded.
+# The qualifier will result in a new track or file being creating for
+# each qualifier. No identifier will result in a single file being
+# used system-wide (not desirable)
+# TODO: we mostly likely do not have enough information to do this
+# until party identification is completed and even then it is not
+# clear that it will available at this point. I just think it would
+# be useful for this to work this way.
+#
+#
+qualifier=caller
+
diff --git a/config/FileMediaSetup.config b/config/FileMediaSetup.config
new file mode 100755
index 0000000..4f0ec4d
--- /dev/null
+++ b/config/FileMediaSetup.config
@@ -0,0 +1,6 @@
+#
+# A sample configuration file for the file media component service.
+#
+
+[general]
+
diff --git a/slice/AsteriskSCF/Media/File/FileMediaIf.ice b/slice/AsteriskSCF/Media/File/FileMediaIf.ice
new file mode 100755
index 0000000..dbe66de
--- /dev/null
+++ b/slice/AsteriskSCF/Media/File/FileMediaIf.ice
@@ -0,0 +1,197 @@
+/*
+ * 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
+
+module AsteriskSCF
+{
+module Media
+{
+module File
+{
+module V1
+{
+
+/**
+ *
+ * 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 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 */
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100755
index 0000000..f0c170b
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,8 @@
+include_directories(${logger_dir}/include)
+include_directories(${astscf-ice-util-cpp_dir}/include)
+astscf_component_init(FileMediaService)
+astscf_component_add_ice_libraries(FileMediaService IceStorm)
+astscf_component_add_boost_libraries(FileMediaService core)
+astscf_component_add_slice_collection_libraries(FileMediaService ASTSCF)
+astscf_component_add_build_icebox(FileMediaService)
+target_link_libraries(FileMediaService logging-client astscf-ice-util-cpp)
-----------------------------------------------------------------------
--
asterisk-scf/integration/file_media_service.git
More information about the asterisk-scf-commits
mailing list