X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst-libs%2Fgst%2Frtsp%2Fgstrtspdefs.c;h=667538f99037ac3b4ea84a8de3bf0f8537bb18cc;hb=4898c305377c1c28fa5754714db9b75f3619518b;hp=e39059cfc7bcb777b3a4506d605a268159accfc8;hpb=e44dd9db8f767f6dd2b157b285774d5938c3fc75;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst-libs/gst/rtsp/gstrtspdefs.c b/gst-libs/gst/rtsp/gstrtspdefs.c index e39059c..667538f 100644 --- a/gst-libs/gst/rtsp/gstrtspdefs.c +++ b/gst-libs/gst/rtsp/gstrtspdefs.c @@ -13,8 +13,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* * Unless otherwise indicated, Source Code is licensed under MIT license. @@ -174,6 +174,9 @@ static struct rtsp_header rtsp_headers[] = { /* Since 0.10.36 */ {"RTCP-Interval", FALSE}, + /* Since 1.4 */ + {"KeyMgmt", FALSE}, + {NULL, FALSE} }; @@ -229,6 +232,7 @@ rtsp_init_status (void) "Only aggregate operation allowed"); DEF_STATUS (GST_RTSP_STS_UNSUPPORTED_TRANSPORT, "Unsupported transport"); DEF_STATUS (GST_RTSP_STS_DESTINATION_UNREACHABLE, "Destination unreachable"); + DEF_STATUS (GST_RTSP_STS_KEY_MANAGEMENT_FAILURE, "Key management failure"); DEF_STATUS (GST_RTSP_STS_INTERNAL_SERVER_ERROR, "Internal Server Error"); DEF_STATUS (GST_RTSP_STS_NOT_IMPLEMENTED, "Not Implemented"); DEF_STATUS (GST_RTSP_STS_BAD_GATEWAY, "Bad Gateway"); @@ -427,8 +431,6 @@ gst_rtsp_find_method (const gchar * method) * Convert @options to a string. * * Returns: a new string of @options. g_free() after usage. - * - * Since: 0.10.23 */ gchar * gst_rtsp_options_as_text (GstRTSPMethod options) @@ -468,14 +470,52 @@ gst_rtsp_options_as_text (GstRTSPMethod options) } /** + * gst_rtsp_options_from_text: + * @options: a comma separated list of options + * + * Convert the comma separated list @options to a #GstRTSPMethod bitwise or + * of methods. This functions is the reverse of gst_rtsp_options_as_text(). + * + * Returns: a #GstRTSPMethod + * + * Since: 1.2 + */ +GstRTSPMethod +gst_rtsp_options_from_text (const gchar * options) +{ + GstRTSPMethod methods; + gchar **ostr; + gint i; + + /* The string is like: + * OPTIONS, DESCRIBE, ANNOUNCE, PLAY, SETUP, ... + */ + ostr = g_strsplit (options, ",", 0); + + methods = 0; + for (i = 0; ostr[i]; i++) { + gchar *stripped; + GstRTSPMethod method; + + stripped = g_strstrip (ostr[i]); + method = gst_rtsp_find_method (stripped); + + /* keep bitfield of supported methods */ + if (method != GST_RTSP_INVALID) + methods |= method; + } + g_strfreev (ostr); + + return methods; +} + +/** * gst_rtsp_header_allow_multiple: * @field: a #GstRTSPHeaderField * * Check whether @field may appear multiple times in a message. * * Returns: %TRUE if multiple headers are allowed. - * - * Since: 0.10.25 */ gboolean gst_rtsp_header_allow_multiple (GstRTSPHeaderField field)