2 * Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 #include "rtsp-media-factory.h"
24 #ifndef __GST_RTSP_MEDIA_FACTORY_WFD_H__
25 #define __GST_RTSP_MEDIA_FACTORY_WFD_H__
28 /* types for the media factory */
29 #define GST_TYPE_RTSP_MEDIA_FACTORY_WFD (gst_rtsp_media_factory_wfd_get_type ())
30 #define GST_IS_RTSP_MEDIA_FACTORY_WFD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD))
31 #define GST_IS_RTSP_MEDIA_FACTORY_WFD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_WFD))
32 #define GST_RTSP_MEDIA_FACTORY_WFD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFDClass))
33 #define GST_RTSP_MEDIA_FACTORY_WFD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFD))
34 #define GST_RTSP_MEDIA_FACTORY_WFD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFDClass))
35 #define GST_RTSP_MEDIA_FACTORY_WFD_CAST(obj) ((GstRTSPMediaFactoryWFD*)(obj))
36 #define GST_RTSP_MEDIA_FACTORY_WFD_CLASS_CAST(klass) ((GstRTSPMediaFactoryWFDClass*)(klass))
39 GST_WFD_VSRC_XIMAGESRC,
40 GST_WFD_VSRC_XVIMAGESRC,
41 GST_WFD_VSRC_CAMERASRC,
42 GST_WFD_VSRC_VIDEOTESTSRC
45 typedef struct _GstRTSPMediaFactoryWFD GstRTSPMediaFactoryWFD;
46 typedef struct _GstRTSPMediaFactoryWFDClass GstRTSPMediaFactoryWFDClass;
47 typedef struct _GstRTSPMediaFactoryWFDPrivate GstRTSPMediaFactoryWFDPrivate;
50 * GstRTSPMediaFactoryWFD:
52 * The definition and logic for constructing the pipeline for a media. The media
53 * can contain multiple streams like audio and video.
55 struct _GstRTSPMediaFactoryWFD
57 GstRTSPMediaFactory parent;
60 GstRTSPMediaFactoryWFDPrivate *priv;
61 gpointer _gst_reserved[GST_PADDING];
65 * GstRTSPMediaFactoryWFDClass:
66 * @gen_key: convert @url to a key for caching shared #GstRTSPMedia objects.
67 * The default implementation of this function will use the complete URL
68 * including the query parameters to return a key.
69 * @create_element: Construct and return a #GstElement that is a #GstBin containing
70 * the elements to use for streaming the media. The bin should contain
71 * payloaders pay\%d for each stream. The default implementation of this
72 * function returns the bin created from the launch parameter.
73 * @construct: the vmethod that will be called when the factory has to create the
74 * #GstRTSPMedia for @url. The default implementation of this
75 * function calls create_element to retrieve an element and then looks for
76 * pay\%d to create the streams.
77 * @create_pipeline: create a new pipeline or re-use an existing one and
78 * add the #GstRTSPMedia's element created by @construct to the pipeline.
79 * @configure: configure the media created with @construct. The default
80 * implementation will configure the 'shared' property of the media.
81 * @media_constructed: signal emited when a media was constructed
82 * @media_configure: signal emited when a media should be configured
84 * The #GstRTSPMediaFactoryWFD class structure.
86 struct _GstRTSPMediaFactoryWFDClass
88 GstRTSPMediaFactoryClass parent_class;
90 gchar *(*gen_key) (GstRTSPMediaFactoryWFD * factory, const GstRTSPUrl * url);
92 GstElement *(*create_element) (GstRTSPMediaFactoryWFD * factory,
93 const GstRTSPUrl * url);
94 GstRTSPMedia *(*construct) (GstRTSPMediaFactoryWFD * factory,
95 const GstRTSPUrl * url);
96 GstElement *(*create_pipeline) (GstRTSPMediaFactoryWFD * factory,
97 GstRTSPMedia * media);
98 void (*configure) (GstRTSPMediaFactoryWFD * factory, GstRTSPMedia * media);
101 void (*media_constructed) (GstRTSPMediaFactoryWFD * factory,
102 GstRTSPMedia * media);
103 void (*media_configure) (GstRTSPMediaFactoryWFD * factory,
104 GstRTSPMedia * media);
107 gpointer _gst_reserved[GST_PADDING_LARGE];
110 GType gst_rtsp_media_factory_wfd_get_type (void);
112 /* creating the factory */
113 GstRTSPMediaFactoryWFD *gst_rtsp_media_factory_wfd_new (void);
114 GstElement *gst_rtsp_media_factory_wfd_create_element (GstRTSPMediaFactoryWFD *
115 factory, const GstRTSPUrl * url);
117 void gst_rtsp_media_factory_wfd_set (GstRTSPMediaFactoryWFD * factory,
118 guint8 videosrc_type, gchar *audio_device, guint64 audio_latency_time,
119 guint64 audio_buffer_time, gboolean audio_do_timestamp, guint mtu_size);
120 void gst_rtsp_media_factory_wfd_set_dump_ts (GstRTSPMediaFactoryWFD * factory,
122 void gst_rtsp_media_factory_wfd_set_negotiated_resolution (GstRTSPMediaFactory *factory,
123 guint32 width, guint32 height);
126 #endif /* __GST_RTSP_MEDIA_FACTORY_WFD_H__ */