2 * Copyright (C) 2015 Samsung Electronics Hyunjun Ko <zzoon.ko@samsung.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,
43 GST_WFD_VSRC_WAYLANDSRC
46 typedef struct _GstRTSPMediaFactoryWFD GstRTSPMediaFactoryWFD;
47 typedef struct _GstRTSPMediaFactoryWFDClass GstRTSPMediaFactoryWFDClass;
48 typedef struct _GstRTSPMediaFactoryWFDPrivate GstRTSPMediaFactoryWFDPrivate;
51 * GstRTSPMediaFactoryWFD:
53 * The definition and logic for constructing the pipeline for a media. The media
54 * can contain multiple streams like audio and video.
56 struct _GstRTSPMediaFactoryWFD
58 GstRTSPMediaFactory parent;
61 GstRTSPMediaFactoryWFDPrivate *priv;
62 gpointer _gst_reserved[GST_PADDING];
66 * GstRTSPMediaFactoryWFDClass:
67 * @gen_key: convert @url to a key for caching shared #GstRTSPMedia objects.
68 * The default implementation of this function will use the complete URL
69 * including the query parameters to return a key.
70 * @create_element: Construct and return a #GstElement that is a #GstBin containing
71 * the elements to use for streaming the media. The bin should contain
72 * payloaders pay\%d for each stream. The default implementation of this
73 * function returns the bin created from the launch parameter.
74 * @construct: the vmethod that will be called when the factory has to create the
75 * #GstRTSPMedia for @url. The default implementation of this
76 * function calls create_element to retrieve an element and then looks for
77 * pay\%d to create the streams.
78 * @create_pipeline: create a new pipeline or re-use an existing one and
79 * add the #GstRTSPMedia's element created by @construct to the pipeline.
80 * @configure: configure the media created with @construct. The default
81 * implementation will configure the 'shared' property of the media.
82 * @media_constructed: signal emited when a media was constructed
83 * @media_configure: signal emited when a media should be configured
85 * The #GstRTSPMediaFactoryWFD class structure.
87 struct _GstRTSPMediaFactoryWFDClass
89 GstRTSPMediaFactoryClass parent_class;
91 gchar *(*gen_key) (GstRTSPMediaFactoryWFD * factory, const GstRTSPUrl * url);
93 GstElement *(*create_element) (GstRTSPMediaFactoryWFD * factory,
94 const GstRTSPUrl * url);
95 GstRTSPMedia *(*construct) (GstRTSPMediaFactoryWFD * factory,
96 const GstRTSPUrl * url);
97 GstElement *(*create_pipeline) (GstRTSPMediaFactoryWFD * factory,
98 GstRTSPMedia * media);
99 void (*configure) (GstRTSPMediaFactoryWFD * factory, GstRTSPMedia * media);
102 void (*media_constructed) (GstRTSPMediaFactoryWFD * factory,
103 GstRTSPMedia * media);
104 void (*media_configure) (GstRTSPMediaFactoryWFD * factory,
105 GstRTSPMedia * media);
108 gpointer _gst_reserved[GST_PADDING_LARGE];
111 GType gst_rtsp_media_factory_wfd_get_type (void);
113 /* creating the factory */
114 GstRTSPMediaFactoryWFD *gst_rtsp_media_factory_wfd_new (void);
115 GstElement *gst_rtsp_media_factory_wfd_create_element (GstRTSPMediaFactoryWFD *
116 factory, const GstRTSPUrl * url);
118 void gst_rtsp_media_factory_wfd_set (GstRTSPMediaFactoryWFD * factory,
119 guint8 videosrc_type, gchar *audio_device, guint64 audio_latency_time,
120 guint64 audio_buffer_time, gboolean audio_do_timestamp, guint mtu_size);
121 void gst_rtsp_media_factory_wfd_set_encoders (GstRTSPMediaFactoryWFD * factory,
122 gchar *video_encoder, gchar *audio_encoder_aac, gchar *audio_encoder_ac3);
123 void gst_rtsp_media_factory_wfd_set_dump_ts (GstRTSPMediaFactoryWFD * factory,
125 void gst_rtsp_media_factory_wfd_set_negotiated_resolution (GstRTSPMediaFactory *factory,
126 guint32 width, guint32 height);
127 void gst_rtsp_media_factory_wfd_set_audio_codec (GstRTSPMediaFactory *factory,
130 void gst_rtsp_media_factory_wfd_set_venc_bitrate (GstRTSPMediaFactory *factory,
132 void gst_rtsp_media_factory_wfd_get_venc_bitrate (GstRTSPMediaFactory *factory,
134 void gst_rtsp_media_factory_wfd_get_config_bitrate (GstRTSPMediaFactory *factory,
135 guint32 *min, guint32 *max);
136 void gst_rtsp_media_factory_wfd_set_config_bitrate (GstRTSPMediaFactoryWFD *factory,
137 guint *config_bitrate);
140 #endif /* __GST_RTSP_MEDIA_FACTORY_WFD_H__ */