static GstPad *
-setup_src_pad (GstElement * element,
- GstStaticPadTemplate * template, GstCaps * caps)
+setup_src_pad (GstElement * element, GstStaticPadTemplate * template)
{
GstPad *srcpad, *sinkpad;
GST_ELEMENT_NAME (element));
/* references are owned by: 1) us, 2) matroskamux, 3) collect pads */
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 3);
- if (caps)
- fail_unless (gst_pad_set_caps (srcpad, caps));
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
gst_object_unref (sinkpad); /* because we got it higher up */
}
static GstPad *
-setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
- GstCaps * caps)
+setup_sink_pad (GstElement * element, GstStaticPadTemplate * template)
{
GstPad *srcpad, *sinkpad;
srcpad = gst_element_get_static_pad (element, "src");
fail_if (srcpad == NULL, "Could not get source pad from %s",
GST_ELEMENT_NAME (element));
- if (caps)
- fail_unless (gst_pad_set_caps (sinkpad, caps));
gst_pad_set_chain_function (sinkpad, gst_check_chain_func);
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
setup_matroskamux (GstStaticPadTemplate * srctemplate)
{
GstElement *matroskamux;
- GstSegment segment;
GST_DEBUG ("setup_matroskamux");
matroskamux = gst_check_setup_element ("matroskamux");
g_object_set (matroskamux, "version", 1, NULL);
- mysrcpad = setup_src_pad (matroskamux, srctemplate, NULL);
- mysinkpad = setup_sink_pad (matroskamux, &sinktemplate, NULL);
+ mysrcpad = setup_src_pad (matroskamux, srctemplate);
+ mysinkpad = setup_sink_pad (matroskamux, &sinktemplate);
fail_unless (gst_element_set_state (matroskamux,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
- gst_segment_init (&segment, GST_FORMAT_TIME);
- fail_unless (gst_pad_push_event (mysrcpad,
- gst_event_new_segment (&segment)), "Segment event rejected");
-
return matroskamux;
}
int num_buffers;
int i;
gint available;
+ GstCaps *caps;
guint8 data[] =
{ 0x1a, 0x45, 0xdf, 0xa3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
0x42, 0x82, 0x89, 0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61, 0x00,
matroskamux = setup_matroskamux (&srcac3template);
+ caps = gst_caps_from_string (srcac3template.static_caps.string);
+ gst_check_setup_events (mysrcpad, matroskamux, caps, GST_FORMAT_TIME);
+ gst_caps_unref (caps);
+
inbuffer = gst_buffer_new_allocate (NULL, 1, 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
matroskamux = setup_matroskamux (&srcvorbistemplate);
caps = gst_caps_from_string (VORBIS_CAPS_STRING);
- fail_unless (gst_pad_set_caps (mysrcpad, caps));
+ gst_check_setup_events (mysrcpad, matroskamux, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
inbuffer = gst_buffer_new_allocate (NULL, 1, 0);
matroskamux = setup_matroskamux (&srcac3template);
caps = gst_caps_from_string (AC3_CAPS_STRING);
- fail_unless (gst_pad_set_caps (mysrcpad, caps));
+ gst_check_setup_events (mysrcpad, matroskamux, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
/* Generate the header */
GstBuffer *outbuffer;
int num_buffers;
int i;
+ GstCaps *caps;
matroskamux = setup_matroskamux (&srcac3template);
+ caps = gst_caps_from_string (srcac3template.static_caps.string);
+ gst_check_setup_events (mysrcpad, matroskamux, caps, GST_FORMAT_TIME);
+ gst_caps_unref (caps);
+
inbuffer = gst_buffer_new_allocate (NULL, 1, 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
GstElement *mux;
mux = gst_check_setup_element ("webmmux");
- mysinkpad = setup_sink_pad (mux, &webm_sinktemplate, NULL);
+ mysinkpad = setup_sink_pad (mux, &webm_sinktemplate);
fail_unless (mysinkpad != NULL);
fail_unless (gst_element_set_state (mux,