mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
jpegenc: declare quality property changeable in PLAYING state
https://bugzilla.gnome.org/show_bug.cgi?id=785012
This commit is contained in:
parent
4bcec1b190
commit
ab3b289bf2
1 changed files with 6 additions and 1 deletions
|
@ -134,7 +134,8 @@ gst_jpegenc_class_init (GstJpegEncClass * klass)
|
||||||
g_object_class_install_property (gobject_class, PROP_QUALITY,
|
g_object_class_install_property (gobject_class, PROP_QUALITY,
|
||||||
g_param_spec_int ("quality", "Quality", "Quality of encoding",
|
g_param_spec_int ("quality", "Quality", "Quality of encoding",
|
||||||
0, 100, JPEG_DEFAULT_QUALITY,
|
0, 100, JPEG_DEFAULT_QUALITY,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
|
GST_PARAM_MUTABLE_PLAYING));
|
||||||
|
|
||||||
#ifdef ENABLE_SMOOTHING
|
#ifdef ENABLE_SMOOTHING
|
||||||
/* disabled, since it doesn't seem to work */
|
/* disabled, since it doesn't seem to work */
|
||||||
|
@ -474,9 +475,13 @@ gst_jpegenc_handle_frame (GstVideoEncoder * encoder, GstVideoCodecFrame * frame)
|
||||||
#if JPEG_LIB_VERSION >= 70
|
#if JPEG_LIB_VERSION >= 70
|
||||||
jpegenc->cinfo.do_fancy_downsampling = FALSE;
|
jpegenc->cinfo.do_fancy_downsampling = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (jpegenc);
|
||||||
jpegenc->cinfo.smoothing_factor = jpegenc->smoothing;
|
jpegenc->cinfo.smoothing_factor = jpegenc->smoothing;
|
||||||
jpegenc->cinfo.dct_method = jpegenc->idct_method;
|
jpegenc->cinfo.dct_method = jpegenc->idct_method;
|
||||||
jpeg_set_quality (&jpegenc->cinfo, jpegenc->quality, TRUE);
|
jpeg_set_quality (&jpegenc->cinfo, jpegenc->quality, TRUE);
|
||||||
|
GST_OBJECT_UNLOCK (jpegenc);
|
||||||
|
|
||||||
jpeg_start_compress (&jpegenc->cinfo, TRUE);
|
jpeg_start_compress (&jpegenc->cinfo, TRUE);
|
||||||
|
|
||||||
GST_LOG_OBJECT (jpegenc, "compressing");
|
GST_LOG_OBJECT (jpegenc, "compressing");
|
||||||
|
|
Loading…
Reference in a new issue