mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
jpegdec: Avoid unnecessary processing until we have a full picture.
This is for non-packetized mode, when we know the upstream size in bytes.
This commit is contained in:
parent
272683ff36
commit
65d90baf84
1 changed files with 12 additions and 0 deletions
|
@ -872,6 +872,18 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
}
|
||||
buf = NULL;
|
||||
|
||||
/* If we are non-packetized and know the total incoming size in bytes,
|
||||
* just wait until we have enough before doing any processing. */
|
||||
|
||||
if (!dec->packetized && (dec->segment.format == GST_FORMAT_BYTES) &&
|
||||
(dec->segment.stop != -1) &&
|
||||
(GST_BUFFER_SIZE (dec->tempbuf) < dec->segment.stop)) {
|
||||
/* We assume that non-packetized input in bytes is *one* single jpeg image */
|
||||
GST_DEBUG ("Non-packetized mode. Got %d bytes, need %d",
|
||||
GST_BUFFER_SIZE (dec->tempbuf), dec->segment.stop);
|
||||
goto need_more_data;
|
||||
}
|
||||
|
||||
if (!gst_jpeg_dec_ensure_header (dec))
|
||||
goto need_more_data;
|
||||
|
||||
|
|
Loading…
Reference in a new issue