From 75a84adcf721b5965c63f78984b8a624dddf6c0c Mon Sep 17 00:00:00 2001 From: jstebbins Date: Sat, 26 Feb 2011 00:04:39 +0000 Subject: [PATCH] LinGui: remove target file size option git-svn-id: svn://localhost/HandBrake/trunk@3808 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/callbacks.c | 23 --------------------- gtk/src/ghb.ui | 48 +++++-------------------------------------- gtk/src/hb-backend.c | 29 -------------------------- gtk/src/hb-backend.h | 1 - gtk/src/internal_defaults.xml | 4 ---- gtk/src/makedeps.py | 1 - gtk/src/presets.c | 23 +++++---------------- 7 files changed, 10 insertions(+), 119 deletions(-) diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index d6dcb7a3..9355e802 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1491,11 +1491,6 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_adjust_audio_rate_combos(ud); ghb_set_pref_audio(titleindex, ud); ghb_set_pref_subtitle(titleindex, ud); - if (ghb_settings_get_boolean(ud->settings, "vquality_type_target")) - { - gint bitrate = ghb_calculate_target_bitrate (ud->settings, titleindex); - ghb_ui_update(ud, "VideoAvgBitrate", ghb_int64_value(bitrate)); - } // Unfortunately, there is no way to query how many frames were // actually generated during the scan. @@ -1672,24 +1667,6 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } G_MODULE_EXPORT void -target_size_changed_cb(GtkWidget *widget, signal_user_data_t *ud) -{ - const gchar *name = ghb_get_setting_key(widget); - g_debug("target_size_changed_cb () %s", name); - ghb_widget_to_setting(ud->settings, widget); - ghb_check_dependency(ud, widget, NULL); - ghb_clear_presets_selection(ud); - ghb_live_reset(ud); - if (ghb_settings_get_boolean(ud->settings, "vquality_type_target")) - { - gint titleindex; - titleindex = ghb_settings_combo_int(ud->settings, "title"); - gint bitrate = ghb_calculate_target_bitrate (ud->settings, titleindex); - ghb_ui_update(ud, "VideoAvgBitrate", ghb_int64_value(bitrate)); - } -} - -G_MODULE_EXPORT void start_point_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { gint start, end; diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 7297f117..bbe73362 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -1920,49 +1920,11 @@ FFmpeg's and Theora's scale is more linear. These encoders do not have a lossle - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Set the desired final size of the output file. This uses the known duration of the video to calculate the bitrate that will be required to achieve the desired size. - Target Size (MB): - True - vquality_type_constant - - - - 0 - 1 - 3 - 4 - GTK_FILL - GTK_FILL - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Set the desired final size of the output file. This uses the known duration of the video to calculate the bitrate that will be required to achieve the desired size. - adjustment4 - - - - 1 - 2 - 3 - 4 - GTK_FILL - - - - True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Perform 2 Pass Encoding. 'Bitrate' or 'Target Size' options are prerequisites. During the 1st pass, statistics about the video are collected. Then in the second pass, those statistics are used to make bitrate allocation decisions. + Perform 2 Pass Encoding. The 'Bitrate' option is prerequisite. During the 1st pass, statistics about the video are collected. Then in the second pass, those statistics are used to make bitrate allocation decisions. 2-Pass Encoding True @@ -1970,8 +1932,8 @@ FFmpeg's and Theora's scale is more linear. These encoders do not have a lossle 0 1 - 4 - 5 + 3 + 4 GTK_FILL GTK_FILL @@ -1997,8 +1959,8 @@ FFmpeg's and Theora's scale is more linear. These encoders do not have a lossle 0 1 - 5 - 6 + 4 + 5 GTK_FILL GTK_FILL diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index c73d63df..0f7bba1a 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3856,24 +3856,6 @@ set_preview_job_settings(hb_job_t *job, GValue *settings) } } -gint -ghb_calculate_target_bitrate(GValue *settings, gint titleindex) -{ - hb_list_t * list; - hb_title_t * title; - hb_job_t * job; - gint size; - - if (h_scan == NULL) return 1500; - list = hb_get_titles( h_scan ); - title = hb_list_item( list, titleindex ); - if (title == NULL) return 1500; - job = title->job; - if (job == NULL) return 1500; - size = ghb_settings_get_int(settings, "VideoTargetSize"); - return hb_calc_bitrate( job, size ); -} - gboolean ghb_validate_filter_string(const gchar *str, gint max_fields) { @@ -4702,17 +4684,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) hb_audio_add( job, &audio ); tcount++; } - // I was tempted to move this up with the reset of the video quality - // settings, but I suspect the settings above need to be made - // first in order for hb_calc_bitrate to be accurate. - if (ghb_settings_get_boolean(js, "vquality_type_target")) - { - gint size; - - size = ghb_settings_get_int(js, "VideoTargetSize"); - job->vbitrate = hb_calc_bitrate( job, size ); - job->vquality = -1.0; - } dest_str = ghb_settings_get_string(js, "destination"); job->file = dest_str; diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 547415cf..8109fde3 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -156,7 +156,6 @@ gchar* ghb_build_x264opts_string(GValue *settings); GdkPixbuf* ghb_get_preview_image( gint titleindex, gint index, signal_user_data_t *ud, gint *width, gint *height); -gint ghb_calculate_target_bitrate(GValue *settings, gint titleindex); gchar* ghb_dvd_volname(const gchar *device); gint ghb_get_title_number(gint titleindex); gint ghb_subtitle_track_source(signal_user_data_t *ud, gint track); diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index ed238707..3041bc34 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -104,8 +104,6 @@ vquality_type_constant - vquality_type_target - SrtLanguage und SrtCodeset @@ -212,8 +210,6 @@ vquality_type_constant - vquality_type_target - VideoFramerateCFR VideoFrameratePFR diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index 3f894287..3950acc4 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -21,7 +21,6 @@ dep_map = ( DepEntry("angle_count", "angle", "1", True, True), DepEntry("angle_count", "angle_label", "1", True, True), DepEntry("vquality_type_bitrate", "VideoAvgBitrate", "TRUE", False, False), - DepEntry("vquality_type_target", "VideoTargetSize", "TRUE", False, False), DepEntry("vquality_type_constant", "VideoQualitySlider", "TRUE", False, False), DepEntry("vquality_type_constant", "VideoTwoPass", "TRUE", True, False), DepEntry("vquality_type_constant", "VideoTurboTwoPass", "TRUE", True, False), diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 17e00346..2e231bfd 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -2643,21 +2643,18 @@ import_xlat_preset(GValue *dict) } break; } // VideoQualityType/0/1/2 - vquality_type_/target/bitrate/constant + // *note: target is no longer used switch (vqtype) { case 0: { - ghb_dict_insert(dict, g_strdup("vquality_type_target"), - ghb_boolean_value_new(TRUE)); ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"), - ghb_boolean_value_new(FALSE)); + ghb_boolean_value_new(TRUE)); ghb_dict_insert(dict, g_strdup("vquality_type_constant"), ghb_boolean_value_new(FALSE)); } break; case 1: { - ghb_dict_insert(dict, g_strdup("vquality_type_target"), - ghb_boolean_value_new(FALSE)); ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"), ghb_boolean_value_new(TRUE)); ghb_dict_insert(dict, g_strdup("vquality_type_constant"), @@ -2665,8 +2662,6 @@ import_xlat_preset(GValue *dict) } break; case 2: { - ghb_dict_insert(dict, g_strdup("vquality_type_target"), - ghb_boolean_value_new(FALSE)); ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"), ghb_boolean_value_new(FALSE)); ghb_dict_insert(dict, g_strdup("vquality_type_constant"), @@ -2674,8 +2669,6 @@ import_xlat_preset(GValue *dict) } break; default: { - ghb_dict_insert(dict, g_strdup("vquality_type_target"), - ghb_boolean_value_new(FALSE)); ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"), ghb_boolean_value_new(FALSE)); ghb_dict_insert(dict, g_strdup("vquality_type_constant"), @@ -2825,12 +2818,10 @@ import_xlat_presets(GValue *presets) static void export_xlat_preset(GValue *dict) { - gboolean autoscale, target, br, constant; + gboolean autoscale, br, constant; g_debug("export_xlat_prest ()"); autoscale = ghb_value_boolean(preset_dict_get_value(dict, "autoscale")); - target = ghb_value_boolean( - preset_dict_get_value(dict, "vquality_type_target")); br = ghb_value_boolean( preset_dict_get_value(dict, "vquality_type_bitrate")); constant = ghb_value_boolean( @@ -2844,12 +2835,8 @@ export_xlat_preset(GValue *dict) ghb_int_value_new(1)); // VideoQualityType/0/1/2 - vquality_type_/target/bitrate/constant - if (target) - { - ghb_dict_insert(dict, g_strdup("VideoQualityType"), - ghb_int_value_new(0)); - } - else if (br) + // *note: target is no longer used + if (br) { ghb_dict_insert(dict, g_strdup("VideoQualityType"), ghb_int_value_new(1)); -- 2.11.0