summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-02-26 00:04:39 +0000
committerjstebbins <[email protected]>2011-02-26 00:04:39 +0000
commita307ad5134dedd0b441f94c0c097525674494fee (patch)
tree63e5ab268b8538b2c651c48b42a7574cc6aae819 /gtk/src
parent53f02c5320d04bd46aed8fb1c1624b8d96ba0e7c (diff)
LinGui: remove target file size option
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3808 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c23
-rw-r--r--gtk/src/ghb.ui48
-rw-r--r--gtk/src/hb-backend.c29
-rw-r--r--gtk/src/hb-backend.h1
-rw-r--r--gtk/src/internal_defaults.xml4
-rw-r--r--gtk/src/makedeps.py1
-rw-r--r--gtk/src/presets.c23
7 files changed, 10 insertions, 119 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index d6dcb7a31..9355e802e 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 7297f1177..bbe733628 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
</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>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index c73d63dfe..0f7bba1a9 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 547415cf3..8109fde33 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 ed2387077..3041bc342 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -104,8 +104,6 @@
<false />
<key>vquality_type_constant</key>
<false />
- <key>vquality_type_target</key>
- <false />
<key>SrtLanguage</key>
<string>und</string>
<key>SrtCodeset</key>
@@ -212,8 +210,6 @@
<false />
<key>vquality_type_constant</key>
<false />
- <key>vquality_type_target</key>
- <false />
<key>VideoFramerateCFR</key>
<false />
<key>VideoFrameratePFR</key>
diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py
index 3f894287d..3950acc44 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 17e00346b..2e231bfd1 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));