Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-10-03 18:29:49 +0300
committerTim-Philipp Müller <tim@centricular.com>2020-07-10 18:45:50 +0300
commitf42afec4712501b25294cbcd2a8768a89db66d51 (patch)
tree92edea92c0e21f810932ca97fb398196f20664a0 /sys
parent38ef8c2411fec2c8319d36a76b58b9c716f0b2a9 (diff)
rpicamsrc: Switch back to MJPEG codec for image/jpeg
The JPEG codec hangs, not sure why yet. The MJPEG codec doesn't provide a quality setting, and sometimes freezes on shutdown, but otherwise seems more reliable
Diffstat (limited to 'sys')
-rw-r--r--sys/rpicamsrc/gstrpicamsrc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/rpicamsrc/gstrpicamsrc.c b/sys/rpicamsrc/gstrpicamsrc.c
index 542c3bb24..a9cf7cd89 100644
--- a/sys/rpicamsrc/gstrpicamsrc.c
+++ b/sys/rpicamsrc/gstrpicamsrc.c
@@ -78,6 +78,9 @@
GST_DEBUG_CATEGORY (gst_rpi_cam_src_debug);
+/* comment out to use JPEG codec instead of MJPEG */
+// #define USE_JPEG_CODEC
+
/* Filter signals and args */
enum
{
@@ -299,10 +302,12 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
"Bitrate for encoding. 0 for VBR using quantisation-parameter", 0,
BITRATE_HIGHEST, BITRATE_DEFAULT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#ifdef USE_JPEG_CODEC
g_object_class_install_property (gobject_class, PROP_JPEG_QUALITY,
g_param_spec_int ("jpeg-quality", "JPEG Quality",
"Quality setting for JPEG encode", 1, 100, DEFAULT_JPEG_QUALITY,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
g_object_class_install_property (gobject_class, PROP_KEYFRAME_INTERVAL,
g_param_spec_int ("keyframe-interval", "Keyframe Interface",
"Interval (in frames) between I frames. -1 = automatic, 0 = single-keyframe",
@@ -1307,7 +1312,11 @@ gst_rpi_cam_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
}
}
else if (gst_structure_has_name (structure, "image/jpeg")) {
+#ifdef USE_JPEG_CODEC
src->capture_config.encoding = MMAL_ENCODING_JPEG;
+#else
+ src->capture_config.encoding = MMAL_ENCODING_MJPEG;
+#endif
}
else {
/* Raw caps */