OSDN Git Service

LinGui: remove target file size option
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 26 Feb 2011 00:04:39 +0000 (00:04 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 26 Feb 2011 00:04:39 +0000 (00:04 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@3808 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c
gtk/src/ghb.ui
gtk/src/hb-backend.c
gtk/src/hb-backend.h
gtk/src/internal_defaults.xml
gtk/src/makedeps.py
gtk/src/presets.c

index d6dcb7a..9355e80 100644 (file)
@@ -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;
index 7297f11..bbe7336 100644 (file)
@@ -1920,49 +1920,11 @@ FFmpeg's and Theora's scale is more linear.  These encoders do not have a lossle
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkRadioButton" id="vquality_type_target">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="tooltip-text" translatable="yes">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.</property>
-                                <property name="label" translatable="yes">Target Size (MB):</property>
-                                <property name="draw_indicator">True</property>
-                                <property name="group">vquality_type_constant</property>
-                                <signal handler="target_size_changed_cb" name="toggled"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="right_attach">1</property>
-                                <property name="top_attach">3</property>
-                                <property name="bottom_attach">4</property>
-                                <property name="y_options">GTK_FILL</property>
-                                <property name="x_options">GTK_FILL</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkSpinButton" id="VideoTargetSize">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="tooltip-text" translatable="yes">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.</property>
-                                <property name="adjustment">adjustment4</property>
-                                <signal handler="target_size_changed_cb" name="value_changed"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">3</property>
-                                <property name="bottom_attach">4</property>
-                                <property name="y_options">GTK_FILL</property>
-                                <property name="x_options"></property>
-                              </packing>
-                            </child>
-                            <child>
                               <object class="GtkCheckButton" id="VideoTwoPass">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="tooltip-text" translatable="yes">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.</property>
+                                <property name="tooltip-text" translatable="yes">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.</property>
                                 <property name="label" translatable="yes">2-Pass Encoding</property>
                                 <property name="draw_indicator">True</property>
                                 <signal handler="setting_widget_changed_cb" name="toggled"/>
@@ -1970,8 +1932,8 @@ FFmpeg's and Theora's scale is more linear.  These encoders do not have a lossle
                               <packing>
                                 <property name="left_attach">0</property>
                                 <property name="right_attach">1</property>
-                                <property name="top_attach">4</property>
-                                <property name="bottom_attach">5</property>
+                                <property name="top_attach">3</property>
+                                <property name="bottom_attach">4</property>
                                 <property name="y_options">GTK_FILL</property>
                                 <property name="x_options">GTK_FILL</property>
                               </packing>
@@ -1997,8 +1959,8 @@ FFmpeg's and Theora's scale is more linear.  These encoders do not have a lossle
                               <packing>
                                 <property name="left_attach">0</property>
                                 <property name="right_attach">1</property>
-                                <property name="top_attach">5</property>
-                                <property name="bottom_attach">6</property>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
                                 <property name="y_options">GTK_FILL</property>
                                 <property name="x_options">GTK_FILL</property>
                               </packing>
index c73d63d..0f7bba1 100644 (file)
@@ -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;
index 547415c..8109fde 100644 (file)
@@ -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);
index ed23870..3041bc3 100644 (file)
                <false />
                <key>vquality_type_constant</key>
                <false />
-               <key>vquality_type_target</key>
-               <false />
                <key>SrtLanguage</key>
                <string>und</string>
                <key>SrtCodeset</key>
                <false />
                <key>vquality_type_constant</key>
                <false />
-               <key>vquality_type_target</key>
-               <false />
                <key>VideoFramerateCFR</key>
                <false />
                <key>VideoFrameratePFR</key>
index 3f89428..3950acc 100644 (file)
@@ -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),
index 17e0034..2e231bf 100644 (file)
@@ -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));