[asterisk-commits] dlee: branch dlee/playback r388223 - in /team/dlee/playback: include/asterisk...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 9 16:29:23 CDT 2013


Author: dlee
Date: Thu May  9 16:29:21 2013
New Revision: 388223

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388223
Log:
Comments; define message type

Modified:
    team/dlee/playback/include/asterisk/stasis_app_playback.h
    team/dlee/playback/res/res_stasis_playback.c

Modified: team/dlee/playback/include/asterisk/stasis_app_playback.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback/include/asterisk/stasis_app_playback.h?view=diff&rev=388223&r1=388222&r2=388223
==============================================================================
--- team/dlee/playback/include/asterisk/stasis_app_playback.h (original)
+++ team/dlee/playback/include/asterisk/stasis_app_playback.h Thu May  9 16:29:21 2013
@@ -71,18 +71,47 @@
 
 /*!
  * \brief Gets the current state of a playback operation.
+ *
+ * \param playback Playback control object.
+ * \return The state of the \a playback object.
  */
 enum stasis_app_playback_state stasis_app_playback_get_state(
 	struct stasis_app_playback *playback);
 
+/*!
+ * \brief Gets the unique id of a playback object.
+ *
+ * \param playback Playback control object.
+ * \return \a playback's id.
+ * \return \c NULL if \a playback ic \c NULL
+ */
 const char *stasis_app_playback_get_id(
 	struct stasis_app_playback *playback);
 
+/*!
+ * \brief Finds the playback object with the given id.
+ *
+ * \param id Id of the playback object to find.
+ * \return Associated \ref stasis_app_playback object.
+ * \return \c NULL if \a id not found.
+ */
 struct stasis_app_playback *stasis_app_playback_find_by_id(const char *id);
 
+/*!
+ * \brief Controls the media for a given playback operation.
+ *
+ * \param playback Playback control object.
+ * \param control Media control operation.
+ * \return 0 on success
+ * \return non-zero on error.
+ */
 int stasis_app_playback_control(struct stasis_app_playback *playback,
 	enum stasis_app_playback_media_control control);
 
+/*!
+ * \brief Message type for playback updates. The data is an
+ * \ref ast_channel_blob.
+ */
 struct stasis_message_type *stasis_app_playback_snapshot_type(void);
 
 #endif /* _ASTERISK_STASIS_APP_PLAYBACK_H */

Modified: team/dlee/playback/res/res_stasis_playback.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback/res/res_stasis_playback.c?view=diff&rev=388223&r1=388222&r2=388223
==============================================================================
--- team/dlee/playback/res/res_stasis_playback.c (original)
+++ team/dlee/playback/res/res_stasis_playback.c Thu May  9 16:29:21 2013
@@ -47,6 +47,8 @@
 
 #define SOUND_URI_SCHEME "sound:"
 #define RECORDING_URI_SCHEME "recording:"
+
+STASIS_MESSAGE_TYPE_DEFN(stasis_app_playback_snapshot_type);
 
 /*! Container of all current playbacks */
 static struct ao2_container *playbacks;
@@ -259,6 +261,13 @@
 
 static int load_module(void)
 {
+	int r;
+
+	r = STASIS_MESSAGE_TYPE_INIT(stasis_app_playback_snapshot_type);
+	if (r != 0) {
+		return AST_MODULE_LOAD_FAILURE;
+	}
+
 	playbacks = ao2_container_alloc(PLAYBACK_BUCKETS, playback_hash,
 		playback_cmp);
 	if (!playbacks) {
@@ -271,6 +280,7 @@
 {
 	ao2_cleanup(playbacks);
 	playbacks = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(stasis_app_playback_snapshot_type);
 	return 0;
 }
 




More information about the asterisk-commits mailing list