Skip to content

Commit 7e35538

Browse files
committed
Do not use JPEG parser with MJPEG format
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.
1 parent 5ff7c3c commit 7e35538

File tree

1 file changed

+1
-4
lines changed
  • webcam-capture-drivers/driver-gstreamer/src/main/java/com/github/sarxos/webcam/ds/gstreamer

1 file changed

+1
-4
lines changed

webcam-capture-drivers/driver-gstreamer/src/main/java/com/github/sarxos/webcam/ds/gstreamer/GStreamerDevice.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public class GStreamerDevice implements WebcamDevice, RGBDataSink.Listener, Webc
6767
private Pipeline pipe = null;
6868
private Element source = null;
6969
private Element filter = null;
70-
private Element jpegparse = null;
7170
private Element jpegdec = null;
7271
private Element[] elements = null;
7372
private RGBDataSink sink = null;
@@ -136,7 +135,6 @@ private synchronized void init() {
136135

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

139-
jpegparse = ElementFactory.make("jpegparse", "jpegparse");
140138
jpegdec = ElementFactory.make("jpegdec", "jpegdec");
141139

142140
pipelineReady();
@@ -306,7 +304,7 @@ private void pipelineElementsReset() {
306304
private Element[] pipelineElementsPrepare() {
307305
if (elements == null) {
308306
if (FORMAT_MJPEG.equals(format)) {
309-
elements = new Element[] { source, filter, jpegparse, jpegdec, sink };
307+
elements = new Element[] { source, filter, jpegdec, sink };
310308
} else {
311309
elements = new Element[] { source, filter, sink };
312310
}
@@ -371,7 +369,6 @@ public void dispose() {
371369

372370
source.dispose();
373371
filter.dispose();
374-
jpegparse.dispose();
375372
jpegdec.dispose();
376373
caps.dispose();
377374
sink.dispose();

0 commit comments

Comments
 (0)