Use new still-frame API from gst-plugins-base

This commit is contained in:
Jan Schmidt 2009-11-18 02:15:15 +00:00
parent 0883913fc2
commit baa79ffecb

View File

@ -1609,36 +1609,28 @@ gst_deinterlace_sink_event (GstPad * pad, GstEvent * event)
break; break;
} }
case GST_EVENT_CUSTOM_DOWNSTREAM:{ case GST_EVENT_CUSTOM_DOWNSTREAM:{
const GstStructure *s = gst_event_get_structure (event); gboolean still_state;
if (gst_structure_has_name (s, "application/x-gst-dvd")) { if (gst_video_event_parse_still_frame (event, &still_state)) {
const gchar *event_type; GST_DEBUG_OBJECT (self, "Received still frame event, state %d",
gboolean still_state; still_state);
GST_DEBUG_OBJECT (self, "Received DVD event: %" GST_PTR_FORMAT, s); if (still_state) {
GstFlowReturn ret;
event_type = gst_structure_get_string (s, "event"); GST_DEBUG_OBJECT (self, "Handling still frame");
if (event_type && !strcmp (event_type, "dvd-still") && self->still_frame_mode = TRUE;
gst_structure_get_boolean (s, "still-state", &still_state)) { if (self->last_buffer) {
ret =
if (still_state) { gst_pad_push (self->srcpad, gst_buffer_ref (self->last_buffer));
GstFlowReturn ret; GST_DEBUG_OBJECT (self, "Pushed still frame, result: %s",
gst_flow_get_name (ret));
GST_DEBUG_OBJECT (self, "Handling still frame");
self->still_frame_mode = TRUE;
if (self->last_buffer) {
ret =
gst_pad_push (self->srcpad,
gst_buffer_ref (self->last_buffer));
GST_DEBUG_OBJECT (self, "Pushed still frame, result: %s",
gst_flow_get_name (ret));
} else {
GST_WARNING_OBJECT (self, "No pending buffer!");
}
} else { } else {
GST_DEBUG_OBJECT (self, "Ending still frames"); GST_WARNING_OBJECT (self, "No pending buffer!");
self->still_frame_mode = FALSE;
} }
} else {
GST_DEBUG_OBJECT (self, "Ending still frames");
self->still_frame_mode = FALSE;
} }
} }
} }