[hydra-commits] hydra/slice.git branch "master" updated.
Commits to the Hydra project code repositories
hydra-commits at lists.digium.com
Thu Aug 5 15:27:17 CDT 2010
branch "master" has been updated
via 635497eac50a3a715f65618102876c6fdcd052cd (commit)
via 351a59b2a98c30aa774bbe9f89ae2f49e2bd4e7f (commit)
via b3757265cf118c89a1f5467ca1a9bd54cf8c59d0 (commit)
via faeda274c1ba641464d308219e369483cf702cac (commit)
from 8e63ad48c2132938829d89a23b61a57b81f4a8aa (commit)
Summary of changes:
CMakeLists.txt | 3 +
core/service_locator.ice | 4 +-
media/CMakeLists.txt | 1 +
media/media.ice | 482 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 488 insertions(+), 2 deletions(-)
create mode 100644 media/CMakeLists.txt
create mode 100644 media/media.ice
- Log -----------------------------------------------------------------
commit 635497eac50a3a715f65618102876c6fdcd052cd
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Aug 5 17:42:57 2010 -0300
Update the media slice definition based on new location and module for service locator.
diff --git a/media/media.ice b/media/media.ice
index 2bf761c..daec9a0 100644
--- a/media/media.ice
+++ b/media/media.ice
@@ -1,5 +1,5 @@
#include <Ice/BuiltinSequences.ice>
-#include "service_locator.ice"
+#include "../core/service_locator.ice"
module Hydra
{
@@ -193,7 +193,7 @@ module V1
* A generic format discovery class that can be extended for adding parameters. The parameters are used to find
* a component capable of interpreting and providing a concrete class for a format.
*/
- class FormatDiscovery extends Hydra::Location::V1::ServiceLocatorParams
+ class FormatDiscovery extends Hydra::Core::Discovery::V1::ServiceLocatorParams
{
};
commit 351a59b2a98c30aa774bbe9f89ae2f49e2bd4e7f
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Aug 5 17:42:06 2010 -0300
Add build stuff for media.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf532c1..e646485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,2 +1,5 @@
# Slice definitions for core functionality
add_subdirectory(core)
+
+# Slice definitions for media functionality
+add_subdirectory(media)
diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt
new file mode 100644
index 0000000..d0b531e
--- /dev/null
+++ b/media/CMakeLists.txt
@@ -0,0 +1 @@
+hydra_compile_slice(media.ice lib "Slice Defined API" Core)
commit b3757265cf118c89a1f5467ca1a9bd54cf8c59d0
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Aug 5 17:41:50 2010 -0300
This is now part of core.
diff --git a/core/service_locator.ice b/core/service_locator.ice
index ae0bea9..314dd3f 100644
--- a/core/service_locator.ice
+++ b/core/service_locator.ice
@@ -3,7 +3,7 @@
module Hydra
{
-module System
+module Core
{
module Discovery
@@ -152,6 +152,6 @@ module V1
}; // end module Discovery
-}; // end module System
+}; // end module Core
}; // end module Hydra
commit faeda274c1ba641464d308219e369483cf702cac
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Aug 5 17:41:18 2010 -0300
Add media slice definition.
diff --git a/media/media.ice b/media/media.ice
new file mode 100644
index 0000000..2bf761c
--- /dev/null
+++ b/media/media.ice
@@ -0,0 +1,482 @@
+#include <Ice/BuiltinSequences.ice>
+#include "service_locator.ice"
+
+module Hydra
+{
+
+module Media
+{
+
+module V1
+{
+
+ /**
+ * Forward declaration of the Frame class so we can define a sequence of them.
+ */
+ class Frame;
+
+ /**
+ * Forward declaration of the Format class so we can define a sequence of them.
+ */
+ class Format;
+
+ /**
+ * Forward declaration of the StreamSource interface so we can define a sequence of proxies to them.
+ */
+ interface StreamSource;
+
+ /**
+ * Forward declaration of the StreamSink interface so we can define a sequence of proxies to them.
+ */
+ interface StreamSink;
+
+ /**
+ * A sequence of stream source proxies.
+ */
+ sequence<StreamSource*> StreamSourceSeq;
+
+ /**
+ * A sequence of stream sink proxies.
+ */
+ sequence<StreamSink*> StreamSinkSeq;
+
+ /**
+ * A sequence of concrete formats.
+ */
+ sequence<Format> FormatSeq;
+
+ /**
+ * A sequence of concrete frames.
+ */
+ sequence<Frame> FrameSeq;
+
+ /**
+ * Interface to a container of media sources and sinks.
+ */
+ interface Session
+ {
+ /**
+ * Method which returns the stream sources that are on the session.
+ *
+ * @return StreamSourceSeq A sequence of stream sources.
+ */
+ StreamSourceSeq getSources();
+
+ /**
+ * Method which returns the stream sinks that are on the session.
+ *
+ * @return StreamSinkSeq A sequence of stream sinks.
+ */
+ StreamSinkSeq getSinks();
+
+ /**
+ * Method which returns a unique identifier for the session.
+ *
+ * @return string A string identifier for the session.
+ */
+ idempotent string getId();
+ };
+
+ /**
+ * Exception that gets thrown if a sink receives a format that it can not handle.
+ */
+ exception UnsupportedMediaFormatException { };
+
+ /**
+ * Exception that gets thrown if a fatal error occurs on a stream or sink.
+ */
+ exception FatalStreamException { };
+
+ /**
+ * Exception that gets thrown if a source can not switch to a different format.
+ */
+ exception MediaFormatSwitchException { };
+
+
+ /**
+ * Interface to a source of media.
+ */
+ interface StreamSource
+ {
+ /**
+ * Method which changes where the implementation should send media that originates from itself.
+ *
+ * @param destination A proxy to a stream sink where media will be sent to.
+ */
+ idempotent void setSink(StreamSink* destination);
+
+ /**
+ * Method which retrieves the current stream sink for media.
+ *
+ * @return StreamSink* A proxy to the stream sink where media is being sent to.
+ */
+ idempotent StreamSink* getSink();
+
+ /**
+ * Method which returns the formats that frames from this source may come in.
+ *
+ * @return FormatSeq A sequence of concrete format classes.
+ */
+ idempotent FormatSeq getFormats();
+
+ /**
+ * Method which returns a unique identifier for the source.
+ *
+ * @return string A string identifier for the source.
+ */
+ idempotent string getId();
+
+ /**
+ * Method which requests that the source change the format of frames being sent to the sink.
+ *
+ * @param Format A concrete class describing the format to change to.
+ */
+ void requestFormat(Format newformat) throws MediaFormatSwitchException;
+ };
+
+
+ /**
+ * Interface to a sink for media.
+ */
+ interface StreamSink
+ {
+ /**
+ * Method which gives the implementation a sequence of frames which it will then deal with in an implementation
+ * specific manner.
+ *
+ * @param frames A sequence of frames.
+ */
+ void write(FrameSeq frames) throws UnsupportedMediaFormatException, FatalStreamException;
+
+ /**
+ * Method which changes the source of media being sent to this sink.
+ *
+ * @param source A proxy to the stream source that media is being received from.
+ */
+ idempotent void setSource(StreamSource* source);
+
+ /**
+ * Method which retrieves the current stream source of media.
+ *
+ * @return StreamSource* A proxy to the stream source that media is being received from.
+ */
+ idempotent StreamSource* getSource();
+
+ /**
+ * Method which returns the formats of frames that this sink can handle.
+ *
+ * @return FormatSeq A sequence of concrete format classes.
+ */
+ idempotent FormatSeq getFormats();
+
+ /**
+ * Method which returns a unique identifier for the sink.
+ *
+ * @return string A string identifier for the sink.
+ */
+ idempotent string getId();
+ };
+
+ /**
+ * Interface to a media operation session. This extends the normal Session interface and provides additional
+ * resource specific methods.
+ */
+ interface MediaOperationSession extends Session
+ {
+ /**
+ * Method which releases any resources associated with this media operation session.
+ */
+ void release();
+ };
+
+ /**
+ * A generic format discovery class that can be extended for adding parameters. The parameters are used to find
+ * a component capable of interpreting and providing a concrete class for a format.
+ */
+ class FormatDiscovery extends Hydra::Location::V1::ServiceLocatorParams
+ {
+ };
+
+ /**
+ * A format discovery class that allows finding a format based on name.
+ */
+ class FormatDiscoveryName extends FormatDiscovery
+ {
+ /**
+ * A string identifier for the format.
+ */
+ string name;
+ };
+
+ /**
+ * A sequence of strings with each string containing a format specific parameter from SDP.
+ */
+ sequence<string> SDPFormatParameterSeq;
+
+ /**
+ * A format discovery class that allows finding a format based on information taken from SDP.
+ */
+ class FormatDiscoverySDP extends FormatDiscovery
+ {
+ /**
+ * Numerical payload value given in the SDP.
+ */
+ int payload;
+
+ /**
+ * String type of the format (audio/video/etc)
+ */
+ string type;
+
+ /**
+ * String subtype of the format (in the case of audio something like PCMU)
+ */
+ string subtype;
+
+ /**
+ * Numerical sample rate of the format.
+ */
+ int samplerate;
+
+ /**
+ * A sequence of format specific parameters.
+ */
+ SDPFormatParameterSeq parameters;
+ };
+
+ /**
+ * A format discovery class that allows finding a format based on numerical value, used for IAX2.
+ */
+ class FormatDiscoveryIAX2 extends FormatDiscovery
+ {
+ /**
+ * Numerical codec flag value.
+ */
+ int codec;
+ };
+
+ /**
+ * A format discovery class that allows finding an audio format based on a few parameters.
+ */
+ class FormatDiscoveryGenericAudio extends FormatDiscovery
+ {
+ /**
+ * String name of the codec being used.
+ */
+ string name;
+
+ /**
+ * Numerical sample rate.
+ */
+ int samplerate;
+
+ /**
+ * Number of channels present.
+ */
+ int channels;
+ };
+
+ /**
+ * Interface to a service that interprets format discovery parameters and returns a concrete class
+ * representing them.
+ */
+ interface MediaFormatService
+ {
+ /**
+ * Method which returns a concrete format class given discovery parameters.
+ *
+ * @param format A concrete format discovery class containing parameters of the format.
+ *
+ * @return Format A concrete format class representing the format as described in the
+ * format discovery class.
+ */
+ idempotent Format getFormat(FormatDiscovery format);
+ };
+
+ /**
+ * A generic media operation class that can be extended for adding parameters. The parameters are used to find
+ * a component capable of performing the described operation.
+ */
+ class MediaOperation
+ {
+ };
+
+ /**
+ * A transcoding media operation class that is used to transcode from one format to other.
+ */
+ class MediaOperationTranscode extends MediaOperation
+ {
+ /**
+ * A concrete format class describing the format that frames will be received in.
+ */
+ Format from;
+
+ /**
+ * A concrete format class describing the format that frames should be sent in.
+ */
+ Format to;
+ };
+
+
+ /**
+ * A sequence of media operations. These are ordered in the order in which they should be
+ * executed.
+ */
+ sequence<MediaOperation> MediaOperationSeq;
+
+ /**
+ * A media operation query result class, this gets returned by a media operation service when queried.
+ */
+ class MediaOperationQueryResult
+ {
+ /**
+ * A concrete class describing the operation that the media operation service can perform.
+ */
+ MediaOperation operation;
+
+ /**
+ * An arbitrary numerical score from 1 to 100 of how well the media operation service can perform
+ * the above operation. This value is used to determine the best route and best component to use
+ * for a sequence of media operations when faced with multiple choices.
+ */
+ int score;
+ };
+
+ /**
+ * A sequence of media operation query results, returned by the MediaOperationService interface.
+ */
+ sequence<MediaOperationQueryResult> MediaOperationQueryResultSeq;
+
+ /**
+ * Interface to a service which performs a media operation.
+ */
+ interface MediaOperationService
+ {
+ /**
+ * Method which determines how well supported operations are.
+ *
+ * @param operations A sequence of media operations that are to be performed.
+ *
+ * @return MediaOperationQueryResultSeq A sequence of supported operations with a score of how well
+ * they can be performed.
+ */
+ idempotent MediaOperationQueryResultSeq isSupported(MediaOperationSeq operations);
+
+ /**
+ * Method which allocates a media operation session.
+ *
+ * @param operations A sequence of media operations that are to be performed.
+ *
+ * @return MediaOperationSession* A proxy to a media operation session that will perform the given media
+ * operations.
+ */
+ MediaOperationSession *allocate(MediaOperationSeq operations);
+ };
+
+ /**
+ * A generic frame class that contains common details about frames. Additional classes should extend this to provide
+ * additional details about the frame.
+ */
+ class Frame
+ {
+ /**
+ * A concrete format class describing the format that this frame is in.
+ */
+ Format mediaformat;
+
+ /**
+ * A sequence of bytes which contain the actual data payload of this frame.
+ */
+ Ice::ByteSeq payload;
+ };
+
+ /**
+ * An additional frame class which is provided for stream based frames.
+ */
+ class StreamFrame extends Frame
+ {
+ /**
+ * Timestamp of the frame.
+ */
+ long timestamp;
+
+ /**
+ * Numerical sequence number of the frame.
+ */
+ long seqno;
+ };
+
+ /**
+ * An additional frame class which is provided for audio frames.
+ */
+ class AudioFrame extends StreamFrame
+ {
+ };
+
+ /**
+ * An additional frame class which is provided for video frames.
+ */
+ class VideoFrame extends StreamFrame
+ {
+ };
+
+ /**
+ * A generic format class that provides common information about formats. Additional classes should extend
+ * this to provide additional details about the format.
+ */
+ class Format
+ {
+ /**
+ * A string containing a human readable name for the format, this may not be unique and is
+ * only meant to be used in logging and event messages.
+ */
+ string name;
+ };
+
+ /**
+ * An additional format class which is provided for audio formats.
+ */
+ class AudioFormat extends Format
+ {
+ /**
+ * Numerical sample rate.
+ */
+ int sampleRate;
+
+ /**
+ * Numerical frame size.
+ */
+ int frameSize;
+
+ /**
+ * Numerical maximum frame size that is supported.
+ */
+ int maximumFrameSize;
+
+ /**
+ * Numerical minimum frame size that is supported.
+ */
+ int minimumFrameSize;
+ };
+
+ /**
+ * An additional format class which is provided for video formats.
+ */
+ class VideoFormat extends Format
+ {
+ /**
+ * Numerical maximum allowed bandwidth.
+ */
+ int maximumBandwidth;
+
+ /**
+ * Numerical maximum allowed bitrate.
+ */
+ int maximumBitrate;
+ };
+
+}; // end module V1
+
+}; // end module Media
+
+}; // end module Hydra
-----------------------------------------------------------------------
--
hydra/slice.git
More information about the asterisk-scf-commits
mailing list