(→How to develop a backend) |
(Cleaned up some grammar.) |
||
| (4 intermediate revisions not shown) | |||
| Line 2: | Line 2: | ||
== Introduction == | == Introduction == | ||
| - | This page describes the architecture of umms-0.1 | + | This page describes the architecture of umms-0.1. You can get the code from: git://gitorious.org:meego-middleware/umms.git<br> |
| - | UMMS general description can found on | + | The UMMS general description can found on the '''[[Umms|main page]]''' |
== Class Diagram == | == Class Diagram == | ||
| Line 9: | Line 9: | ||
*'''UmmsAudioManager''' | *'''UmmsAudioManager''' | ||
| - | Class to implement '''''com.UMMS.AudioManager''''' interface which | + | Class to implement the '''''com.UMMS.AudioManager''''' interface which provides a client with an audio output control service. |
*'''UmmsVideoOutput''' | *'''UmmsVideoOutput''' | ||
| - | Class to implement '''''com.UMMS.VideoOutput''''' interface which | + | Class to implement the '''''com.UMMS.VideoOutput''''' interface which provides a client with a video output control service. |
*'''UmmsPlayingContentMetadataViewer''' | *'''UmmsPlayingContentMetadataViewer''' | ||
| - | Class to implement '''''com.UMMS.PlayingContentMetadataViewer''''' interface which | + | Class to implement the '''''com.UMMS.PlayingContentMetadataViewer''''' interface which allows the client to query the current playing content on server side. |
*'''UmmsObjectManager''' | *'''UmmsObjectManager''' | ||
| - | Class to manage MediaPlayer objects, including create/destory, register/unregister MediaPlayer objects. | + | Class to manage the MediaPlayer objects, including create/destory, register/unregister MediaPlayer objects. |
*'''UmmsMediaPlayer''' | *'''UmmsMediaPlayer''' | ||
| - | Class to implement the '''''com.UMMS.MediaPlayer''''' interface which | + | Class to implement the '''''com.UMMS.MediaPlayer''''' interface which provides a media playback service for clients. |
*'''UmmsPlayerBackend''' | *'''UmmsPlayerBackend''' | ||
| - | A base class which | + | A base class which defines an internal interface for media playback. UmmsMediaPlayer uses this class to handle the service request. A backend developer needs to subclass it. |
*'''UmmsAudioManagerBackend''' | *'''UmmsAudioManagerBackend''' | ||
| - | A base class which | + | A base class which defines an internal interface for controlling audio output. UmmsAudioManager uses this class to handle service requests. A backend developer needs to subclass it. |
*'''UmmsVideoOutputBackend''' | *'''UmmsVideoOutputBackend''' | ||
| - | A base class which | + | A base class which defines an internal interface for controlling video output. UmmsVideoOutput uses this class to handle service requests. A backend developer needs to subclass it. |
*'''UmmsPlugin''' | *'''UmmsPlugin''' | ||
| - | A class which | + | A class which defines the plugin mechanism. All backends should inherit from UmmsPlugin. |
*'''Player''' | *'''Player''' | ||
| - | An implementation of UmmsPlayerBackend. | + | An implementation of the UmmsPlayerBackend base class. |
*'''AudioManger''' | *'''AudioManger''' | ||
| - | An implementation of UmmsAudioBackend. | + | An implementation of the UmmsAudioBackend base class. |
*'''VideoOutput''' | *'''VideoOutput''' | ||
| - | An implementation of UmmsVideoOutput. | + | An implementation of the UmmsVideoOutput base class. |
| - | Note that, '''Player''','''AudioManger''','''VideoOutput''' are plugins and will not | + | Note that, '''Player''','''AudioManger''','''VideoOutput''' are plugins and will not be provided by umms-1.0. |
== How to develop a backend == | == How to develop a backend == | ||
Suppose you are going to develop a player backend. | Suppose you are going to develop a player backend. | ||
*'''Step 1: Subclass UmmsPlayerBackend''' | *'''Step 1: Subclass UmmsPlayerBackend''' | ||
| - | The UmmsPlayerBackend is internal interface to abstract all the media playback control. | + | The UmmsPlayerBackend is an internal interface to abstract all the media playback control. The backend developer should subclass this class and implement its vmethods. Of course, you can just implement a subset of the virtual methods defined in UmmsPlayerBackendClass struct, for example. For the dvb player backend, it is optional to implement the "pause" method. If you want to add the time-shifting feature for DVB playback, implementing "pause" method is a choice. |
*'''Step 2: Fill the UmmsPlugin struct in your PlayerBackend.c file and export it''' | *'''Step 2: Fill the UmmsPlugin struct in your PlayerBackend.c file and export it''' | ||
| Line 67: | Line 67: | ||
* as a "black list" of uri. If supported_uri_protocols is not empty, ignore | * as a "black list" of uri. If supported_uri_protocols is not empty, ignore | ||
* unsupported_uri_protocols. | * unsupported_uri_protocols. | ||
| - | * | + | * For example, the implementor can create a black list for its plugin like this: |
* supported_uri_protocols = {NULL}; | * supported_uri_protocols = {NULL}; | ||
* unsupported_uri_protocols = {"dvb"}; | * unsupported_uri_protocols = {"dvb"}; | ||
| Line 79: | Line 79: | ||
}UmmsPlugin; | }UmmsPlugin; | ||
</pre> | </pre> | ||
| - | The most important fields are supported_uri_protocols, unsupported_uri_protocols and backend_new_func. The following is code snapshot to fill the struct: | + | The most important fields are supported_uri_protocols, unsupported_uri_protocols, and backend_new_func. The following is a code snapshot to fill the struct: |
<pre> | <pre> | ||
static gchar *supported_prots[] = { | static gchar *supported_prots[] = { | ||
| Line 108: | Line 108: | ||
}; | }; | ||
</pre> | </pre> | ||
| - | + | Here is a sample player backend based on GStreamer using playbin2: [http://wiki.meego.com/images/Sample-player-backend-0.0.1.tar.gz] | |
Contents |
This page describes the architecture of umms-0.1. You can get the code from: git://gitorious.org:meego-middleware/umms.git
The UMMS general description can found on the main page
Class to implement the com.UMMS.AudioManager interface which provides a client with an audio output control service.
Class to implement the com.UMMS.VideoOutput interface which provides a client with a video output control service.
Class to implement the com.UMMS.PlayingContentMetadataViewer interface which allows the client to query the current playing content on server side.
Class to manage the MediaPlayer objects, including create/destory, register/unregister MediaPlayer objects.
Class to implement the com.UMMS.MediaPlayer interface which provides a media playback service for clients.
A base class which defines an internal interface for media playback. UmmsMediaPlayer uses this class to handle the service request. A backend developer needs to subclass it.
A base class which defines an internal interface for controlling audio output. UmmsAudioManager uses this class to handle service requests. A backend developer needs to subclass it.
A base class which defines an internal interface for controlling video output. UmmsVideoOutput uses this class to handle service requests. A backend developer needs to subclass it.
A class which defines the plugin mechanism. All backends should inherit from UmmsPlugin.
An implementation of the UmmsPlayerBackend base class.
An implementation of the UmmsAudioBackend base class.
An implementation of the UmmsVideoOutput base class.
Note that, Player,AudioManger,VideoOutput are plugins and will not be provided by umms-1.0.
Suppose you are going to develop a player backend.
The UmmsPlayerBackend is an internal interface to abstract all the media playback control. The backend developer should subclass this class and implement its vmethods. Of course, you can just implement a subset of the virtual methods defined in UmmsPlayerBackendClass struct, for example. For the dvb player backend, it is optional to implement the "pause" method. If you want to add the time-shifting feature for DVB playback, implementing "pause" method is a choice.
The definition of struct UmmsPlugin:
typedef struct _UmmsPlugin {
gint major_version;//the major version number of umms core that plugin was compiled for
gint minor_version;//the minor version number of core that plugin was compiled for
UmmsPluginType type;
const gchar *filename;//set by "plugin loader" when this plugin loaded.
const gchar *name;
const gchar *description;
/*
* Used for plugins of UMMS_PLUGIN_TYPE_PLAYER_BACKEND type.
* If supported_uri_protocols is empty, unsupported_uri_protocols is respected
* as a "black list" of uri. If supported_uri_protocols is not empty, ignore
* unsupported_uri_protocols.
* For example, the implementor can create a black list for its plugin like this:
* supported_uri_protocols = {NULL};
* unsupported_uri_protocols = {"dvb"};
* that means the plugin can handle all uri protocols unless "dvb".
*/
const gchar **supported_uri_protocols;
const gchar **unsupported_uri_protocols;
/*vmethod to create the instance of backend.*/
gpointer (*backend_new_func) (void);
}UmmsPlugin;
The most important fields are supported_uri_protocols, unsupported_uri_protocols, and backend_new_func. The following is a code snapshot to fill the struct:
static gchar *supported_prots[] = {
NULL
};
static gchar *unsupported_prots[] = {
"dvb", NULL
};
MyPlayerBackend *my_player_backend_new (void)
{
return g_object_new (MY_TYPE_PLAYER_BACKEND, NULL);
}
/*Plugin description*/
G_MODULE_EXPORT
UmmsPlugin umms_plugin = {
UMMS_VERSION_MAJOR;
UMMS_VERSION_MINOR;
UMMS_PLUGIN_TYPE_PLAYER_BACKEND,
NULL,//should set by loader
"Player",
"Player to handle non-dvb URI",
(const gchar **)&supported_prots,
(const gchar **)&unsupported_prots,
(gpointer (*) (void)) my_player_backend_new
};
Here is a sample player backend based on GStreamer using playbin2: [1]