diff options
author | jstebbins <[email protected]> | 2014-08-12 18:46:41 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-08-12 18:46:41 +0000 |
commit | ff76bd13570c15142cff445dbdcb3cd64a2838a0 (patch) | |
tree | 09963d99906b830908e7505b09a0a90d886cd6b1 /gtk/src/queuehandler.c | |
parent | c89c057ec2e7601f885aafb830732385ece5c59d (diff) |
LinGui: generalize video preset/tune/profile/level handling
This generalization enables x265 preset/tune/profile/level which
did not work previously.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6293 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/queuehandler.c')
-rw-r--r-- | gtk/src/queuehandler.c | 82 |
1 files changed, 45 insertions, 37 deletions
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 6ad412a08..f2d40d3eb 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -472,49 +472,58 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) if (video_encoder->codec == HB_VCODEC_X264 && !ghb_settings_get_boolean(settings, "x264UseAdvancedOptions")) { - const gchar *preset_opt, *tune_opt; - const gchar *profile_opt, *level_opt, *extra_opt; - gboolean fastdecode, zerolatency; - - preset_opt = ghb_settings_get_const_string(settings, "x264Preset"); - tune_opt = ghb_settings_get_const_string(settings, "x264Tune"); - fastdecode = ghb_settings_get_boolean(settings, "x264FastDecode"); - zerolatency = ghb_settings_get_boolean(settings, "x264ZeroLatency"); - profile_opt = ghb_settings_get_const_string(settings, "h264Profile"); - level_opt = ghb_settings_get_const_string(settings, "h264Level"); - extra_opt = ghb_settings_get_const_string(settings, "x264OptionExtra"); - - XPRINT("<b>Video Options:</b> <small>Preset: %s</small>", preset_opt); - if ((tune_opt != NULL && tune_opt[0] != 0) || zerolatency || fastdecode) + const gchar *extra_opt; + + // If the encoder supports presets... + if (hb_video_encoder_get_presets(video_encoder->codec) != NULL) { - const char *prefix = ""; - XPRINT("<small> - Tune: "); - if (tune_opt != NULL && tune_opt[0] != 0) + const gchar *preset_opt, *tune_opt; + const gchar *profile_opt, *level_opt; + gboolean fastdecode, zerolatency; + + preset_opt = ghb_settings_get_const_string(settings, "VideoPreset"); + tune_opt = ghb_settings_get_const_string(settings, "VideoTune"); + fastdecode = ghb_settings_get_boolean(settings, "x264FastDecode"); + zerolatency = ghb_settings_get_boolean(settings, "x264ZeroLatency"); + profile_opt = ghb_settings_get_const_string(settings, "VideoProfile"); + level_opt = ghb_settings_get_const_string(settings, "VideoLevel"); + extra_opt = ghb_settings_get_const_string(settings, "VideoOptionExtra"); + + XPRINT("<b>Video Options:</b> <small>Preset: %s</small>", preset_opt); + if ((tune_opt != NULL && tune_opt[0] != 0) || zerolatency || fastdecode) { - XPRINT("%s%s", prefix, tune_opt); - prefix = ","; + const char *prefix = ""; + XPRINT("<small> - Tune: "); + if (tune_opt != NULL && tune_opt[0] != 0) + { + XPRINT("%s%s", prefix, tune_opt); + prefix = ","; + } + if (video_encoder->codec == HB_VCODEC_X264) + { + if (fastdecode) + { + XPRINT("%sfastdecode", prefix); + prefix = ","; + } + if (zerolatency) + { + XPRINT("%szerolatency", prefix); + prefix = ","; + } + } + XPRINT("</small>"); } - if (fastdecode) + if (profile_opt != NULL && profile_opt[0] != 0) { - XPRINT("%sfastdecode", prefix); - prefix = ","; + XPRINT("<small> - Profile: %s</small>", profile_opt); } - if (zerolatency) + if (level_opt != NULL && level_opt[0] != 0) { - XPRINT("%szerolatency", prefix); - prefix = ","; + XPRINT("<small> - Level: %s</small>", level_opt); } - XPRINT("</small>"); - } - if (profile_opt != NULL && profile_opt[0] != 0) - { - XPRINT("<small> - Profile: %s</small>", profile_opt); - } - if (level_opt != NULL && level_opt[0] != 0) - { - XPRINT("<small> - Level: %s</small>", level_opt); + XPRINT("\n"); } - XPRINT("\n"); // Next line in the display (Video Encoder Options) // Video Advanced Options: detailed settings @@ -523,8 +532,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) XPRINT("<b>Advanced Options:</b> <small>%s</small>\n", extra_opt); } } - else if (video_encoder->codec == HB_VCODEC_X264 || - (video_encoder->codec | HB_VCODEC_FFMPEG_MASK)) + else if (video_encoder->codec == HB_VCODEC_X264) { // Next line in the display (Video Encoder Options) // Video Advanced Options: detailed settings |