static GstFlowReturn theora_enc_chain (GstPad * pad, GstBuffer * buffer);
static GstStateChangeReturn theora_enc_change_state (GstElement * element,
GstStateChange transition);
-static GstCaps *theora_enc_sink_getcaps (GstPad * pad);
+static GstCaps *theora_enc_sink_getcaps (GstPad * pad, GstCaps * filter);
static gboolean theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps);
static void theora_enc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
}
static GstCaps *
-theora_enc_sink_getcaps (GstPad * pad)
+theora_enc_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstCaps *caps;
char *supported_formats, *caps_string;
g_free (supported_formats);
GST_DEBUG ("Supported caps: %" GST_PTR_FORMAT, caps);
+ if (filter) {
+ GstCaps *intersection;
+
+ intersection =
+ gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (caps);
+ caps = intersection;
+ }
+
return caps;
}
buffers = g_slist_reverse (buffers);
/* mark buffers and put on caps */
- caps = gst_pad_get_caps (enc->srcpad);
+ caps = gst_pad_get_caps (enc->srcpad, NULL);
caps = theora_set_header_on_caps (caps, buffers);
GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps);
gst_pad_set_caps (enc->srcpad, caps);
g_assert (!parse->streamheader_received);
- caps = gst_caps_make_writable (gst_pad_get_caps (parse->srcpad));
+ caps = gst_caps_make_writable (gst_pad_get_caps (parse->srcpad, NULL));
theora_parse_set_header_on_caps (parse, caps);
GST_DEBUG_OBJECT (parse, "here are the caps: %" GST_PTR_FORMAT, caps);
gst_pad_set_caps (parse->srcpad, caps);