Skip to content

Commit

Permalink
Do not use JPEG parser with MJPEG format
Browse files Browse the repository at this point in the history
After running few tests it came to be clear that using jpegparse bin
cause FPS slowdown on long running applications. It was ok for taking
single images, but for longer video feed it is unacceptable.
  • Loading branch information
sarxos committed Sep 25, 2017
1 parent 5ff7c3c commit 7e35538
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class GStreamerDevice implements WebcamDevice, RGBDataSink.Listener, Webc
private Pipeline pipe = null;
private Element source = null;
private Element filter = null;
private Element jpegparse = null;
private Element jpegdec = null;
private Element[] elements = null;
private RGBDataSink sink = null;
Expand Down Expand Up @@ -136,7 +135,6 @@ private synchronized void init() {

filter = ElementFactory.make("capsfilter", "capsfilter");

jpegparse = ElementFactory.make("jpegparse", "jpegparse");
jpegdec = ElementFactory.make("jpegdec", "jpegdec");

pipelineReady();
Expand Down Expand Up @@ -306,7 +304,7 @@ private void pipelineElementsReset() {
private Element[] pipelineElementsPrepare() {
if (elements == null) {
if (FORMAT_MJPEG.equals(format)) {
elements = new Element[] { source, filter, jpegparse, jpegdec, sink };
elements = new Element[] { source, filter, jpegdec, sink };
} else {
elements = new Element[] { source, filter, sink };
}
Expand Down Expand Up @@ -371,7 +369,6 @@ public void dispose() {

source.dispose();
filter.dispose();
jpegparse.dispose();
jpegdec.dispose();
caps.dispose();
sink.dispose();
Expand Down

0 comments on commit 7e35538

Please sign in to comment.