GST_DEBUG_CATEGORY (rtsp_media_debug);
#define GST_CAT_DEFAULT rtsp_media_debug
-static void gst_rtsp_media_factory_get_property (GObject *object, guint propid,
- GValue *value, GParamSpec *pspec);
-static void gst_rtsp_media_factory_set_property (GObject *object, guint propid,
- const GValue *value, GParamSpec *pspec);
+static void gst_rtsp_media_factory_get_property (GObject * object, guint propid,
+ GValue * value, GParamSpec * pspec);
+static void gst_rtsp_media_factory_set_property (GObject * object, guint propid,
+ const GValue * value, GParamSpec * pspec);
static void gst_rtsp_media_factory_finalize (GObject * obj);
-static gchar * default_gen_key (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
-static GstElement * default_get_element (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
-static GstRTSPMedia * default_construct (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
-static void default_configure (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
-static GstElement* default_create_pipeline (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
+static gchar *default_gen_key (GstRTSPMediaFactory * factory,
+ const GstRTSPUrl * url);
+static GstElement *default_get_element (GstRTSPMediaFactory * factory,
+ const GstRTSPUrl * url);
+static GstRTSPMedia *default_construct (GstRTSPMediaFactory * factory,
+ const GstRTSPUrl * url);
+static void default_configure (GstRTSPMediaFactory * factory,
+ GstRTSPMedia * media);
+static GstElement *default_create_pipeline (GstRTSPMediaFactory * factory,
+ GstRTSPMedia * media);
G_DEFINE_TYPE (GstRTSPMediaFactory, gst_rtsp_media_factory, G_TYPE_OBJECT);
* named dynpay0, dynpay1, etc..
*/
g_object_class_install_property (gobject_class, PROP_LAUNCH,
- g_param_spec_string ("launch", "Launch", "A launch description of the pipeline",
- DEFAULT_LAUNCH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_string ("launch", "Launch",
+ "A launch description of the pipeline", DEFAULT_LAUNCH,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_SHARED,
- g_param_spec_boolean ("shared", "Shared", "If media from this factory is shared",
- DEFAULT_SHARED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_boolean ("shared", "Shared",
+ "If media from this factory is shared", DEFAULT_SHARED,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_EOS_SHUTDOWN,
g_param_spec_boolean ("eos-shutdown", "EOS Shutdown",
- "Send EOS down the pipeline before shutting down",
+ "Send EOS down the pipeline before shutting down",
DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
klass->gen_key = default_gen_key;
factory->lock = g_mutex_new ();
factory->medias_lock = g_mutex_new ();
factory->medias = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, g_object_unref);
+ g_free, g_object_unref);
}
static void
}
static void
-gst_rtsp_media_factory_get_property (GObject *object, guint propid,
- GValue *value, GParamSpec *pspec)
+gst_rtsp_media_factory_get_property (GObject * object, guint propid,
+ GValue * value, GParamSpec * pspec)
{
GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (object);
g_value_set_boolean (value, gst_rtsp_media_factory_is_shared (factory));
break;
case PROP_EOS_SHUTDOWN:
- g_value_set_boolean (value, gst_rtsp_media_factory_is_eos_shutdown (factory));
+ g_value_set_boolean (value,
+ gst_rtsp_media_factory_is_eos_shutdown (factory));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
}
static void
-gst_rtsp_media_factory_set_property (GObject *object, guint propid,
- const GValue *value, GParamSpec *pspec)
+gst_rtsp_media_factory_set_property (GObject * object, guint propid,
+ const GValue * value, GParamSpec * pspec)
{
GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (object);
gst_rtsp_media_factory_set_shared (factory, g_value_get_boolean (value));
break;
case PROP_EOS_SHUTDOWN:
- gst_rtsp_media_factory_set_eos_shutdown (factory, g_value_get_boolean (value));
+ gst_rtsp_media_factory_set_eos_shutdown (factory,
+ g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
* etc.. Each of the payloaders will result in a stream.
*/
void
-gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory, const gchar *launch)
+gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory * factory,
+ const gchar * launch)
{
g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
g_return_if_fail (launch != NULL);
* Returns: the configured launch description. g_free() after usage.
*/
gchar *
-gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory)
+gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory * factory)
{
gchar *result;
* Configure if media created from this factory can be shared between clients.
*/
void
-gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory,
+gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory * factory,
gboolean shared)
{
g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
* Returns: %TRUE if the media will be shared between clients.
*/
gboolean
-gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory)
+gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory * factory)
{
gboolean result;
* pipeline before shutdown.
*/
void
-gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory *factory,
+gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory * factory,
gboolean eos_shutdown)
{
g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
* Returns: %TRUE if the media will receive EOS before shutdown.
*/
gboolean
-gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory *factory)
+gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory * factory)
{
gboolean result;
}
static gboolean
-compare_media (gpointer key, GstRTSPMedia *media1, GstRTSPMedia *media2)
+compare_media (gpointer key, GstRTSPMedia * media1, GstRTSPMedia * media2)
{
return (media1 == media2);
}
static void
-media_unprepared (GstRTSPMedia *media, GstRTSPMediaFactory *factory)
+media_unprepared (GstRTSPMedia * media, GstRTSPMediaFactory * factory)
{
g_mutex_lock (factory->medias_lock);
- g_hash_table_foreach_remove (factory->medias, (GHRFunc) compare_media,
- media);
+ g_hash_table_foreach_remove (factory->medias, (GHRFunc) compare_media, media);
g_mutex_unlock (factory->medias_lock);
}
* Returns: a new #GstRTSPMedia if the media could be prepared.
*/
GstRTSPMedia *
-gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory, const GstRTSPUrl *url)
+gst_rtsp_media_factory_construct (GstRTSPMediaFactory * factory,
+ const GstRTSPUrl * url)
{
gchar *key;
GstRTSPMedia *media;
media = g_hash_table_lookup (factory->medias, key);
if (media)
g_object_ref (media);
- }
- else
+ } else
media = NULL;
if (media == NULL) {
key = NULL;
}
if (!gst_rtsp_media_is_reusable (media)) {
- /* when not reusable, connect to the unprepare signal to remove the item
- * from our cache when it gets unprepared */
- g_signal_connect (media, "unprepared", (GCallback) media_unprepared,
- factory);
+ /* when not reusable, connect to the unprepare signal to remove the item
+ * from our cache when it gets unprepared */
+ g_signal_connect (media, "unprepared", (GCallback) media_unprepared,
+ factory);
}
}
}
}
static gchar *
-default_gen_key (GstRTSPMediaFactory *factory, const GstRTSPUrl *url)
+default_gen_key (GstRTSPMediaFactory * factory, const GstRTSPUrl * url)
{
gchar *result;
const gchar *pre_query;
pre_query = url->query ? "?" : "";
query = url->query ? url->query : "";
- result = g_strdup_printf ("%u%s%s%s", url->port, url->abspath, pre_query, query);
+ result =
+ g_strdup_printf ("%u%s%s%s", url->port, url->abspath, pre_query, query);
return result;
}
static GstElement *
-default_get_element (GstRTSPMediaFactory *factory, const GstRTSPUrl *url)
+default_get_element (GstRTSPMediaFactory * factory, const GstRTSPUrl * url)
{
GstElement *element;
GError *error = NULL;
parse_error:
{
g_mutex_unlock (factory->lock);
- g_critical ("could not parse launch syntax (%s): %s", factory->launch,
- (error ? error->message : "unknown reason"));
+ g_critical ("could not parse launch syntax (%s): %s", factory->launch,
+ (error ? error->message : "unknown reason"));
if (error)
g_error_free (error);
return NULL;
/* try to find all the payloader elements, they should be named 'pay%d'. for
* each of the payloaders we will create a stream and collect the source pad. */
void
-gst_rtsp_media_factory_collect_streams (GstRTSPMediaFactory *factory, const GstRTSPUrl *url,
- GstRTSPMedia *media)
+gst_rtsp_media_factory_collect_streams (GstRTSPMediaFactory * factory,
+ const GstRTSPUrl * url, GstRTSPMedia * media)
{
GstElement *element, *elem;
- GstPad * pad;
+ GstPad *pad;
gint i;
GstRTSPMediaStream *stream;
gboolean have_elem;
element = media->element;
have_elem = TRUE;
- for (i = 0; have_elem ; i++) {
+ for (i = 0; have_elem; i++) {
gchar *name;
have_elem = FALSE;
}
static GstRTSPMedia *
-default_construct (GstRTSPMediaFactory *factory, const GstRTSPUrl *url)
+default_construct (GstRTSPMediaFactory * factory, const GstRTSPUrl * url)
{
GstRTSPMedia *media;
GstElement *element;
}
}
-static GstElement*
-default_create_pipeline (GstRTSPMediaFactory *factory, GstRTSPMedia *media)
+static GstElement *
+default_create_pipeline (GstRTSPMediaFactory * factory, GstRTSPMedia * media)
{
GstElement *pipeline;
}
static void
-default_configure (GstRTSPMediaFactory *factory, GstRTSPMedia *media)
+default_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media)
{
gboolean shared, eos_shutdown;