1 /* GStreamer RTSP Extension 2 * Copyright (C) 2007 Wim Taymans <wim@fluendo.com> 3 * 4 * gstrtspextension.h: RTSP Extension interface. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_RTSP_EXTENSION_H__ 23 #define __GST_RTSP_EXTENSION_H__ 24 25 #include <gst/gst.h> 26 27 #include <gst/sdp/gstsdpmessage.h> 28 #include <gst/rtsp/gstrtsptransport.h> 29 #include <gst/rtsp/gstrtspmessage.h> 30 #include <gst/rtsp/gstrtspurl.h> 31 32 G_BEGIN_DECLS 33 34 #define GST_TYPE_RTSP_EXTENSION \ 35 (gst_rtsp_extension_get_type ()) 36 #define GST_RTSP_EXTENSION(obj) \ 37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_EXTENSION, GstRTSPExtension)) 38 #define GST_IS_RTSP_EXTENSION(obj) \ 39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_EXTENSION)) 40 #define GST_RTSP_EXTENSION_GET_INTERFACE(inst) \ 41 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_RTSP_EXTENSION, GstRTSPExtensionInterface)) 42 43 /** 44 * GstRTSPExtensionInterface: 45 * 46 * An interface representing RTSP extensions. 47 */ 48 typedef struct _GstRTSPExtension GstRTSPExtension; 49 typedef struct _GstRTSPExtensionInterface GstRTSPExtensionInterface; 50 51 struct _GstRTSPExtensionInterface { 52 GTypeInterface parent; 53 54 /* vfunctions */ 55 gboolean (*detect_server) (GstRTSPExtension *ext, GstRTSPMessage *resp); 56 57 GstRTSPResult (*before_send) (GstRTSPExtension *ext, GstRTSPMessage *req); 58 GstRTSPResult (*after_send) (GstRTSPExtension *ext, GstRTSPMessage *req, GstRTSPMessage *resp); 59 60 GstRTSPResult (*parse_sdp) (GstRTSPExtension *ext, GstSDPMessage *sdp, GstStructure *s); 61 GstRTSPResult (*setup_media) (GstRTSPExtension *ext, GstSDPMedia *media); 62 63 gboolean (*configure_stream) (GstRTSPExtension *ext, GstCaps *caps); 64 65 GstRTSPResult (*get_transports) (GstRTSPExtension *ext, GstRTSPLowerTrans protocols, gchar **transport); 66 67 GstRTSPResult (*stream_select) (GstRTSPExtension *ext, GstRTSPUrl *url); 68 69 /* signals */ 70 GstRTSPResult (*send) (GstRTSPExtension *ext, GstRTSPMessage *req, GstRTSPMessage *resp); 71 72 /* ABI: more vfunctions added later */ 73 GstRTSPResult (*receive_request) (GstRTSPExtension *ext, GstRTSPMessage *req); 74 75 /*< private >*/ 76 gpointer _gst_reserved[GST_PADDING]; 77 }; 78 79 GST_RTSP_API 80 GType gst_rtsp_extension_get_type (void); 81 82 /* invoke vfunction on interface */ 83 84 GST_RTSP_API 85 gboolean gst_rtsp_extension_detect_server (GstRTSPExtension *ext, GstRTSPMessage *resp); 86 87 GST_RTSP_API 88 GstRTSPResult gst_rtsp_extension_before_send (GstRTSPExtension *ext, GstRTSPMessage *req); 89 90 GST_RTSP_API 91 GstRTSPResult gst_rtsp_extension_after_send (GstRTSPExtension *ext, GstRTSPMessage *req, 92 GstRTSPMessage *resp); 93 94 GST_RTSP_API 95 GstRTSPResult gst_rtsp_extension_parse_sdp (GstRTSPExtension *ext, GstSDPMessage *sdp, 96 GstStructure *s); 97 98 GST_RTSP_API 99 GstRTSPResult gst_rtsp_extension_setup_media (GstRTSPExtension *ext, GstSDPMedia *media); 100 101 GST_RTSP_API 102 gboolean gst_rtsp_extension_configure_stream (GstRTSPExtension *ext, GstCaps *caps); 103 104 GST_RTSP_API 105 GstRTSPResult gst_rtsp_extension_get_transports (GstRTSPExtension *ext, GstRTSPLowerTrans protocols, 106 gchar **transport); 107 108 GST_RTSP_API 109 GstRTSPResult gst_rtsp_extension_stream_select (GstRTSPExtension *ext, GstRTSPUrl *url); 110 111 GST_RTSP_API 112 GstRTSPResult gst_rtsp_extension_receive_request (GstRTSPExtension *ext, GstRTSPMessage *req); 113 114 /* signal emission */ 115 116 GST_RTSP_API 117 GstRTSPResult gst_rtsp_extension_send (GstRTSPExtension *ext, GstRTSPMessage *req, 118 GstRTSPMessage *resp); 119 120 G_END_DECLS 121 122 #endif /* __GST_RTSP_EXTENSION_H__ */ 123