[asterisk-commits] file: branch file/media r167170 - in /team/file/media: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 4 16:56:01 CST 2009


Author: file
Date: Sun Jan  4 16:56:01 2009
New Revision: 167170

URL: http://svn.digium.com/view/asterisk?view=rev&rev=167170
Log:
Add skeletons for the ast_media_format_list stuff.

Modified:
    team/file/media/include/asterisk/media.h
    team/file/media/main/media.c

Modified: team/file/media/include/asterisk/media.h
URL: http://svn.digium.com/view/asterisk/team/file/media/include/asterisk/media.h?view=diff&rev=167170&r1=167169&r2=167170
==============================================================================
--- team/file/media/include/asterisk/media.h (original)
+++ team/file/media/include/asterisk/media.h Sun Jan  4 16:56:01 2009
@@ -85,6 +85,12 @@
 	};
 };
 
+/*!
+ * \brief Structure that represents a list of media formats
+ */
+struct ast_media_format_list {
+};
+	
 /*! \brief Initialize core parts for media formats
  *
  * Example usage:
@@ -130,6 +136,101 @@
  * by media_format.
  */
 struct ast_media_format *ast_media_format_unref(struct ast_media_format *media_format);	
+
+/*! \brief Initialize a media format list
+ *
+ * \param media_format_list The media format list structure to initialize
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * struct ast_media_format_list media_format_list;
+ * ast_media_format_list_init(&media_format_list);
+ * \endcode
+ *
+ * This initializes the defined media format list structure media_format_list.
+ */
+int ast_media_format_list_init(struct ast_media_format_list *media_format_list);	
+
+/*! \brief Add a media format to a media format list
+ *
+ * \param media_format_list List that the media format is to be added to
+ * \param media_format The media format structure to add
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * ast_media_format_list_add(&media_format_list, media_format);
+ * \endcode
+ *
+ * This adds the media format pointed to by media_format to the media format list.
+ * It is added as the last element.
+ */
+int ast_media_format_list_add(struct ast_media_format_list *media_format_list, struct ast_media_format *media_format);	
+
+/*! \brief Remove a media format from a media format list
+ *
+ * \param media_format_list List to remove the media format from
+ * \param media_format The media format to remove
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * ast_media_format_list_remove(&media_format_list, media_format);
+ * \endcode
+ *
+ * This removes the media format pointed to by media_format from the media format list.
+ */
+int ast_media_format_list_remove(struct ast_media_format_list *media_format_list, struct ast_media_format *media_format);
+	
+/*! \brief Retrieve a media format from a media format list
+ *
+ * \param media_format_list List to retrieve the media format from
+ * \param num What media format to get
+ *
+ * \retval non-NULL on success
+ * \retval NULL on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * struct ast_media_format *media_format = ast_media_format_list_get(&media_format_list, 0);
+ * \endcode
+ *
+ * This gets the first media format that was added to the media format list.
+ *
+ * \note The media format is returned with the reference count increased. You must call
+ *       ast_media_format_unref on it once done.
+ */
+struct ast_media_format *ast_media_format_list_get(struct ast_media_format_list *media_format_list, unsigned int num);	
+	
+/*! \brief Destroy the contents of a media format list
+ *
+ * \param media_format_list List that is to be destroyed
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * ast_media_format_list_destroy(&media_format_list);
+ * \endcode
+ *
+ * This destroys the contents of the media format list.
+ *
+ * \note This does not destroy the actual media_format_list structure itself.
+ */
+int ast_media_format_list_destroy(struct ast_media_format_list *media_format_list);	
 	
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/file/media/main/media.c
URL: http://svn.digium.com/view/asterisk/team/file/media/main/media.c?view=diff&rev=167170&r1=167169&r2=167170
==============================================================================
--- team/file/media/main/media.c (original)
+++ team/file/media/main/media.c Sun Jan  4 16:56:01 2009
@@ -84,6 +84,31 @@
 {
 	ao2_ref(media_format, -1);
 	return NULL;
+}
+
+int ast_media_format_list_init(struct ast_media_format_list *media_format_list)
+{
+	return -1;
+}
+
+int ast_media_format_list_add(struct ast_media_format_list *media_format_list, struct ast_media_format *media_format)
+{
+	return -1;
+}
+
+int ast_media_format_list_remove(struct ast_media_format_list *media_format_list, struct ast_media_format *media_format)
+{
+	return -1;
+}
+
+struct ast_media_format *ast_media_format_list_get(struct ast_media_format_list *media_format_list, unsigned int num)
+{
+	return NULL;
+}
+
+int ast_media_format_list_destroy(struct ast_media_format_list *media_format_list)
+{
+	return -1;
 }
 
 /*! \brief Conversion function which takes a media format enum and turns it into a string */




More information about the asterisk-commits mailing list