Convert the incoming caps before proxying them
Clear the last_pad when going to ready
tests: Implement accept_caps, don't leak event
{
GstRTPMux *rtp_mux = user_data;
{
GstRTPMux *rtp_mux = user_data;
- gst_pad_push_event (rtp_mux->srcpad, gst_event_ref (*event));
+ if (GST_EVENT_TYPE (*event) == GST_EVENT_CAPS) {
+ GstCaps *caps;
+
+ gst_event_parse_caps (*event, &caps);
+ gst_rtp_mux_setcaps (pad, rtp_mux, caps);
+ } else {
+ gst_pad_push_event (rtp_mux->srcpad, gst_event_ref (*event));
+ }
gst_rtp_mux_change_state (GstElement * element, GstStateChange transition)
{
GstRTPMux *rtp_mux;
gst_rtp_mux_change_state (GstElement * element, GstStateChange transition)
{
GstRTPMux *rtp_mux;
+ GstStateChangeReturn ret;
rtp_mux = GST_RTP_MUX (element);
switch (transition) {
rtp_mux = GST_RTP_MUX (element);
switch (transition) {
- case GST_STATE_CHANGE_NULL_TO_READY:
- break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_rtp_mux_ready_to_paused (rtp_mux);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_rtp_mux_ready_to_paused (rtp_mux);
break;
+ default:
+ break;
+ }
+
+ ret = GST_ELEMENT_CLASS (gst_rtp_mux_parent_class)->change_state (element,
+ transition);
+
+ switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ g_clear_object (&rtp_mux->last_pad);
- return GST_ELEMENT_CLASS (gst_rtp_mux_parent_class)->change_state (element,
- transition);
gst_query_set_caps_result (query, *caps);
break;
}
gst_query_set_caps_result (query, *caps);
break;
}
+ case GST_QUERY_ACCEPT_CAPS:
+ gst_query_set_accept_caps_result (query, TRUE);
+ break;
gst_event_parse_caps (event, &caps);
fail_unless (caps2 != NULL && *caps2 != NULL);
gst_event_parse_caps (event, &caps);
fail_unless (caps2 != NULL && *caps2 != NULL);
- fail_unless (gst_caps_is_equal (caps, *caps2));
+ fail_unless (gst_caps_is_fixed (caps));
+ fail_unless (gst_caps_is_fixed (*caps2));
+ fail_unless (gst_caps_is_equal_fixed (caps, *caps2));
- gst_event_unref (event);
+ gst_event_unref (event);
+