appsrc: remove filter argument from gst_app_src_get_caps()

Was presumably added by mistaken in the grand _get_caps()
conversion. Doesn't really make sense for a property accessor.
This commit is contained in:
Tim-Philipp Müller 2012-05-17 22:04:24 +01:00
parent 8f08f6d256
commit e110d8b6f4
2 changed files with 25 additions and 27 deletions

View file

@ -557,7 +557,27 @@ gst_app_src_finalize (GObject * obj)
static GstCaps * static GstCaps *
gst_app_src_internal_get_caps (GstBaseSrc * bsrc, GstCaps * filter) gst_app_src_internal_get_caps (GstBaseSrc * bsrc, GstCaps * filter)
{ {
return gst_app_src_get_caps (GST_APP_SRC_CAST (bsrc), filter); GstAppSrc *appsrc = GST_APP_SRC (bsrc);
GstCaps *caps;
GST_OBJECT_LOCK (appsrc);
if ((caps = appsrc->priv->caps))
gst_caps_ref (caps);
GST_OBJECT_UNLOCK (appsrc);
if (filter) {
if (caps) {
GstCaps *intersection =
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (caps);
caps = intersection;
} else {
caps = gst_caps_ref (filter);
}
}
GST_DEBUG_OBJECT (appsrc, "caps: %" GST_PTR_FORMAT, caps);
return caps;
} }
static void static void
@ -623,7 +643,7 @@ gst_app_src_get_property (GObject * object, guint prop_id, GValue * value,
GstCaps *caps; GstCaps *caps;
/* we're missing a _take_caps() function to transfer ownership */ /* we're missing a _take_caps() function to transfer ownership */
caps = gst_app_src_get_caps (appsrc, NULL); caps = gst_app_src_get_caps (appsrc);
gst_value_set_caps (value, caps); gst_value_set_caps (value, caps);
if (caps) if (caps)
gst_caps_unref (caps); gst_caps_unref (caps);
@ -1107,33 +1127,11 @@ gst_app_src_set_caps (GstAppSrc * appsrc, const GstCaps * caps)
* Since: 0.10.22 * Since: 0.10.22
*/ */
GstCaps * GstCaps *
gst_app_src_get_caps (GstAppSrc * appsrc, GstCaps * filter) gst_app_src_get_caps (GstAppSrc * appsrc)
{ {
GstCaps *caps;
GstAppSrcPrivate *priv;
g_return_val_if_fail (GST_IS_APP_SRC (appsrc), NULL); g_return_val_if_fail (GST_IS_APP_SRC (appsrc), NULL);
priv = appsrc->priv; return gst_app_src_internal_get_caps (GST_BASE_SRC_CAST (appsrc), NULL);
GST_OBJECT_LOCK (appsrc);
if ((caps = priv->caps))
gst_caps_ref (caps);
if (filter) {
if (caps) {
GstCaps *intersection =
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (caps);
caps = intersection;
} else {
caps = gst_caps_ref (filter);
}
}
GST_DEBUG_OBJECT (appsrc, "getting caps of %" GST_PTR_FORMAT, caps);
GST_OBJECT_UNLOCK (appsrc);
return caps;
} }
/** /**

View file

@ -122,7 +122,7 @@ GType gst_app_src_get_type(void);
GType gst_app_stream_type_get_type (void); GType gst_app_stream_type_get_type (void);
void gst_app_src_set_caps (GstAppSrc *appsrc, const GstCaps *caps); void gst_app_src_set_caps (GstAppSrc *appsrc, const GstCaps *caps);
GstCaps* gst_app_src_get_caps (GstAppSrc *appsrc, GstCaps * filter); GstCaps* gst_app_src_get_caps (GstAppSrc *appsrc);
void gst_app_src_set_size (GstAppSrc *appsrc, gint64 size); void gst_app_src_set_size (GstAppSrc *appsrc, gint64 size);
gint64 gst_app_src_get_size (GstAppSrc *appsrc); gint64 gst_app_src_get_size (GstAppSrc *appsrc);