jpeg2000parse: use pre_push_frame to reset parser

This commit is contained in:
Aaron Boxer 2019-08-08 15:27:11 -04:00 committed by GStreamer Merge Bot
parent bfee115d66
commit 7b3491adf7

View file

@ -121,6 +121,8 @@ static void gst_jpeg2000_parse_reset (GstBaseParse * parse,
gboolean hard_reset); gboolean hard_reset);
static GstFlowReturn gst_jpeg2000_parse_handle_frame (GstBaseParse * parse, static GstFlowReturn gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
GstBaseParseFrame * frame, gint * skipsize); GstBaseParseFrame * frame, gint * skipsize);
static GstFlowReturn gst_jpeg2000_parse_pre_push_frame (GstBaseParse * parse,
GstBaseParseFrame * frame);
static gboolean gst_jpeg2000_parse_set_sink_caps (GstBaseParse * parse, static gboolean gst_jpeg2000_parse_set_sink_caps (GstBaseParse * parse,
GstCaps * caps); GstCaps * caps);
static GstJPEG2000ParseFormats static GstJPEG2000ParseFormats
@ -148,6 +150,8 @@ gst_jpeg2000_parse_class_init (GstJPEG2000ParseClass * klass)
parse_class->sink_event = GST_DEBUG_FUNCPTR (gst_jpeg2000_parse_event); parse_class->sink_event = GST_DEBUG_FUNCPTR (gst_jpeg2000_parse_event);
parse_class->handle_frame = parse_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_jpeg2000_parse_handle_frame); GST_DEBUG_FUNCPTR (gst_jpeg2000_parse_handle_frame);
parse_class->pre_push_frame =
GST_DEBUG_FUNCPTR (gst_jpeg2000_parse_pre_push_frame);
} }
static void static void
@ -773,7 +777,8 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
gst_caps_unref (current_caps); gst_caps_unref (current_caps);
gst_buffer_unmap (frame->buffer, &map); gst_buffer_unmap (frame->buffer, &map);
ret = gst_base_parse_finish_frame (parse, frame, jpeg2000parse->frame_size); ret = gst_base_parse_finish_frame (parse, frame, jpeg2000parse->frame_size);
gst_jpeg2000_parse_reset (parse, (ret != GST_FLOW_OK)); if (ret != GST_FLOW_OK)
gst_jpeg2000_parse_reset (parse, TRUE);
return ret; return ret;
beach: beach:
@ -784,3 +789,12 @@ beach:
gst_jpeg2000_parse_reset (parse, TRUE); gst_jpeg2000_parse_reset (parse, TRUE);
return ret; return ret;
} }
static GstFlowReturn
gst_jpeg2000_parse_pre_push_frame (GstBaseParse * parse,
GstBaseParseFrame * frame)
{
gst_jpeg2000_parse_reset (parse, FALSE);
return GST_FLOW_OK;
}