diff options
author | Rodeo <[email protected]> | 2011-09-19 21:15:01 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2011-09-19 21:15:01 +0000 |
commit | a3367322b982a61975df2a28307455d16a7ab081 (patch) | |
tree | 6cd2359254fc23066d3a08e9edfc43e93898937c /gtk | |
parent | 3453ca5ca1601c613e2998fc18ce49f5a13fe0b5 (diff) |
libhb: Auto Passthru and audio/video encoder lists.
This adds Auto Passthru as another encoder in libhb.
Used in LinGUI and CLI. MacGUI features a partial impplmentation (with hardcoded values), which is disabled for now.
Also, audio and video encoders are now stored in "lists", like we previously did for mixdowns.
New mixdown "None" (HB_AMIXDOWN_NONE) added to hb_audio_mixdowns (was previously declared in MacGUI/LinGUI).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4237 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/audiohandler.c | 164 | ||||
-rw-r--r-- | gtk/src/audiohandler.h | 4 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 283 | ||||
-rw-r--r-- | gtk/src/presets.c | 10 |
4 files changed, 276 insertions, 185 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 9729f1b33..90256d6cf 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -26,127 +26,69 @@ static GValue* get_selected_asettings(signal_user_data_t *ud); static gboolean block_updates = FALSE; gint -ghb_select_audio_codec(int mux, hb_audio_config_t *aconfig, gint acodec, gint fallback) +ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint fallback, gint copy_mask) { guint32 in_codec = aconfig ? aconfig->in.codec : HB_ACODEC_MASK; - if (mux == HB_MUX_MP4) + if (acodec == HB_ACODEC_AUTO_PASS) { - if (acodec & HB_ACODEC_PASS_FLAG) - { - if ((acodec & in_codec & HB_ACODEC_PASS_MASK & ~HB_ACODEC_VORBIS)) - { - return acodec & (in_codec | HB_ACODEC_PASS_FLAG); - } - else if (fallback) - { - return fallback; - } - else - { - return HB_ACODEC_FAAC; - } - } - else if (acodec & HB_ACODEC_AC3) - { - return HB_ACODEC_AC3; - } - else if (acodec & HB_ACODEC_LAME) - { - return HB_ACODEC_LAME; - } - else if (acodec & HB_ACODEC_FAAC) - { - return HB_ACODEC_FAAC; - } - else if (acodec & HB_ACODEC_FFAAC) - { - return HB_ACODEC_FFAAC; - } - else if (fallback) - { - return fallback; - } - else - { - return HB_ACODEC_FAAC; - } + return hb_autopassthru_get_encoder(in_codec, copy_mask, fallback, mux); } - else + + gint ii; + // Sanitize fallback + for (ii = 0; ii < hb_audio_encoders_count; ii++) { - if (acodec & HB_ACODEC_PASS_FLAG) + if (hb_audio_encoders[ii].encoder == fallback && + !(hb_audio_encoders[ii].muxers & mux)) { - if ((acodec & in_codec & HB_ACODEC_PASS_MASK)) - { - return acodec & (in_codec | HB_ACODEC_PASS_FLAG); - } - else if (fallback) - { - return fallback; - } + if ( mux == HB_MUX_MKV ) + fallback = HB_ACODEC_LAME; else - { - return HB_ACODEC_FAAC; - } + fallback = HB_ACODEC_FAAC; + break; } - else if (acodec & HB_ACODEC_AC3) - { - return HB_ACODEC_AC3; - } - else if (acodec & HB_ACODEC_LAME) - { - return HB_ACODEC_LAME; - } - else if (acodec & HB_ACODEC_VORBIS) - { - return HB_ACODEC_VORBIS; - } - else if (acodec & HB_ACODEC_FAAC) - { - return HB_ACODEC_FAAC; - } - else if (acodec & HB_ACODEC_FFAAC) - { - return HB_ACODEC_FFAAC; - } - else if (fallback ) + } + if ((acodec & HB_ACODEC_PASS_FLAG) && + !(acodec & in_codec & HB_ACODEC_PASS_MASK)) + { + return fallback; + } + for (ii = 0; ii < hb_audio_encoders_count; ii++) + { + if (hb_audio_encoders[ii].encoder == acodec && + !(hb_audio_encoders[ii].muxers & mux)) { return fallback; } - else - { - return HB_ACODEC_LAME; - } } + return acodec; } -int ghb_allowed_passthru_mask(GValue *settings, int acodec) +int ghb_get_copy_mask(GValue *settings) { - gint ret = acodec; - - if (acodec == HB_ACODEC_ANY) - { - if (!ghb_settings_get_boolean(settings, "AudioAllowMP3Pass")) - { - ret &= ~HB_ACODEC_MP3; - } - if (!ghb_settings_get_boolean(settings, "AudioAllowAACPass")) - { - ret &= ~HB_ACODEC_FFAAC; - } - if (!ghb_settings_get_boolean(settings, "AudioAllowAC3Pass")) - { - ret &= ~HB_ACODEC_AC3; - } - if (!ghb_settings_get_boolean(settings, "AudioAllowDTSPass")) - { - ret &= ~HB_ACODEC_DCA; - } - if (!ghb_settings_get_boolean(settings, "AudioAllowDTSHDPass")) - { - ret &= ~HB_ACODEC_DCA_HD; - } - } - return ret; + gint mask = 0; + + if (ghb_settings_get_boolean(settings, "AudioAllowMP3Pass")) + { + mask |= HB_ACODEC_MP3; + } + if (ghb_settings_get_boolean(settings, "AudioAllowAACPass")) + { + mask |= HB_ACODEC_FFAAC; + } + if (ghb_settings_get_boolean(settings, "AudioAllowAC3Pass")) + { + mask |= HB_ACODEC_AC3; + } + if (ghb_settings_get_boolean(settings, "AudioAllowDTSPass")) + { + mask |= HB_ACODEC_DCA; + } + if (ghb_settings_get_boolean(settings, "AudioAllowDTSHDPass")) + { + mask |= HB_ACODEC_DCA_HD; + } + return mask; } static int ghb_select_fallback( GValue *settings, int mux, int acodec ) @@ -223,8 +165,8 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud) sr = aconfig ? aconfig->in.samplerate : 48000; } gint fallback = ghb_select_fallback( ud->settings, mux, acodec ); - select_acodec = ghb_allowed_passthru_mask(ud->settings, acodec); - select_acodec = ghb_select_audio_codec(mux, aconfig, select_acodec, fallback); + gint copy_mask = ghb_get_copy_mask(ud->settings); + select_acodec = ghb_select_audio_codec(mux, aconfig, acodec, fallback, copy_mask); gboolean codec_defined_bitrate = FALSE; if (ghb_audio_is_passthru (select_acodec)) { @@ -339,8 +281,8 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) audio = ghb_array_get_nth(pref_audio, ii); acodec = ghb_settings_combo_int(audio, "AudioEncoder"); fallback = ghb_select_fallback( ud->settings, mux, acodec ); - select_acodec = ghb_allowed_passthru_mask(ud->settings, acodec); - select_acodec = ghb_select_audio_codec(mux, NULL, select_acodec, fallback); + gint copy_mask = ghb_get_copy_mask(ud->settings); + select_acodec = ghb_select_audio_codec(mux, NULL, acodec, fallback, copy_mask); bitrate = ghb_settings_combo_int(audio, "AudioBitrate"); rate = ghb_settings_combo_double(audio, "AudioSamplerate"); mix = ghb_settings_combo_int(audio, "AudioMixdown"); @@ -361,7 +303,7 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) // HB_ACODEC_* are bit fields. Treat acodec as mask if (!(aconfig->in.codec & select_acodec & HB_ACODEC_PASS_MASK)) { - if (acodec != HB_ACODEC_ANY) + if (acodec != HB_ACODEC_AUTO_PASS) acodec = fallback; // If we can't substitute the passthru with a suitable // encoder and diff --git a/gtk/src/audiohandler.h b/gtk/src/audiohandler.h index 74df87a3d..88ee306ae 100644 --- a/gtk/src/audiohandler.h +++ b/gtk/src/audiohandler.h @@ -34,7 +34,7 @@ void ghb_set_audio(signal_user_data_t *ud, GValue *settings); gchar* ghb_get_user_audio_lang( signal_user_data_t *ud, gint titleindex, gint track); void ghb_audio_list_refresh_selected(signal_user_data_t *ud); -int ghb_allowed_passthru_mask(GValue *settings, int acodec); -gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, int fallback_acodec); +gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint fallback_acodec, gint copy_mask); +int ghb_get_copy_mask(GValue *settings); #endif // _AUDIOHANDLER_H_ diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 400246f5f..733340784 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -236,53 +236,6 @@ combo_opts_t denoise_opts = d_denoise_opts }; -static options_map_t d_vcodec_opts[] = -{ - {"H.264 (x264)", "x264", HB_VCODEC_X264, ""}, - {"MPEG-4 (FFmpeg)", "ffmpeg", HB_VCODEC_FFMPEG_MPEG4, ""}, - {"MPEG-2 (FFmpeg)", "ffmpeg2",HB_VCODEC_FFMPEG_MPEG2, ""}, - {"VP3 (Theora)", "theora", HB_VCODEC_THEORA, ""}, -}; -combo_opts_t vcodec_opts = -{ - sizeof(d_vcodec_opts)/sizeof(options_map_t), - d_vcodec_opts -}; - -static options_map_t d_acodec_opts[] = -{ - {"AAC (faac)", "faac", HB_ACODEC_FAAC, "faac"}, - {"AAC (ffmpeg)", "ffaac", HB_ACODEC_FFAAC, "ffaac"}, - {"MP3 (lame)", "lame", HB_ACODEC_LAME, "lame"}, - {"Vorbis", "vorbis", HB_ACODEC_VORBIS, "vorbis"}, - {"AC3 (ffmpeg)", "ac3", HB_ACODEC_AC3, "ac3"}, - {"MP3 Passthru", "mp3pass", HB_ACODEC_MP3_PASS, "mp3pass"}, - {"AAC Passthru", "aacpass", HB_ACODEC_AAC_PASS, "aacpass"}, - {"AC3 Passthru", "ac3pass", HB_ACODEC_AC3_PASS, "ac3pass"}, - {"DTS Passthru", "dtspass", HB_ACODEC_DCA_PASS, "dtspass"}, - {"DTS-HD Passthru", "dtshdpass", HB_ACODEC_DCA_HD_PASS, "dtshdpass"}, - {"Auto Passthru", "auto", HB_ACODEC_ANY, "auto"}, -}; -combo_opts_t acodec_opts = -{ - sizeof(d_acodec_opts)/sizeof(options_map_t), - d_acodec_opts -}; - -static options_map_t d_acodec_fallback_opts[] = -{ - {"AAC (faac)", "faac", HB_ACODEC_FAAC, "faac"}, - {"AAC (ffmpeg)", "ffaac", HB_ACODEC_FFAAC, "ffaac"}, - {"MP3 (lame)", "lame", HB_ACODEC_LAME, "lame"}, - {"Vorbis", "vorbis", HB_ACODEC_VORBIS, "vorbis"}, - {"AC3 (ffmpeg)", "ac3", HB_ACODEC_AC3, "ac3"}, -}; -combo_opts_t acodec_fallback_opts = -{ - sizeof(d_acodec_fallback_opts)/sizeof(options_map_t), - d_acodec_fallback_opts -}; - static options_map_t d_direct_opts[] = { {"None", "none", 0, "none"}, @@ -432,10 +385,6 @@ combo_name_map_t combo_name_map[] = {"PictureDecomb", &decomb_opts}, {"PictureDetelecine", &detel_opts}, {"PictureDenoise", &denoise_opts}, - {"VideoEncoder", &vcodec_opts}, - {"AudioEncoder", &acodec_opts}, - {"AudioEncoderActual", &acodec_opts}, - {"AudioEncoderFallback", &acodec_fallback_opts}, {"x264_direct", &direct_opts}, {"x264_b_adapt", &badapt_opts}, {"x264_bpyramid", &bpyramid_opts}, @@ -1229,6 +1178,111 @@ lookup_audio_bitrate_option(const GValue *rate) } static gint +lookup_hb_encoder_int(const GValue *enc, hb_encoder_t *encoders, int len) +{ + gint ii; + + if (G_VALUE_TYPE(enc) == G_TYPE_STRING) + { + gchar *str = ghb_value_string(enc); + for (ii = 0; ii < len; ii++) + { + if (strcmp(encoders[ii].human_readable_name, str) == 0 || + strcmp(encoders[ii].short_name, str) == 0) + { + g_free(str); + return encoders[ii].encoder; + } + } + g_free(str); + } + else if (G_VALUE_TYPE(enc) == G_TYPE_INT || + G_VALUE_TYPE(enc) == G_TYPE_INT64 || + G_VALUE_TYPE(enc) == G_TYPE_DOUBLE) + { + int val = ghb_value_int(enc); + for (ii = 0; ii < len; ii++) + { + if (encoders[ii].encoder == val) + { + return encoders[ii].encoder; + } + } + } + return 0; +} + +static const gchar* +lookup_hb_encoder_option(const GValue *enc, hb_encoder_t *encoders, int len) +{ + gint ii; + + if (G_VALUE_TYPE(enc) == G_TYPE_STRING) + { + gchar *str = ghb_value_string(enc); + for (ii = 0; ii < len; ii++) + { + if (strcmp(encoders[ii].human_readable_name, str) == 0 || + strcmp(encoders[ii].short_name, str) == 0) + { + g_free(str); + return encoders[ii].human_readable_name; + } + } + g_free(str); + } + else if (G_VALUE_TYPE(enc) == G_TYPE_INT || + G_VALUE_TYPE(enc) == G_TYPE_INT64 || + G_VALUE_TYPE(enc) == G_TYPE_DOUBLE) + { + int val = ghb_value_int(enc); + for (ii = 0; ii < len; ii++) + { + if (encoders[ii].encoder == val) + { + return encoders[ii].human_readable_name; + } + } + } + return 0; +} + +static const gchar* +lookup_hb_encoder_string(const GValue *enc, hb_encoder_t *encoders, int len) +{ + gint ii; + + if (G_VALUE_TYPE(enc) == G_TYPE_STRING) + { + gchar *str = ghb_value_string(enc); + for (ii = 0; ii < len; ii++) + { + if (strcmp(encoders[ii].human_readable_name, str) == 0 || + strcmp(encoders[ii].short_name, str) == 0) + { + g_free(str); + return encoders[ii].short_name; + } + } + g_free(str); + } + else if (G_VALUE_TYPE(enc) == G_TYPE_INT || + G_VALUE_TYPE(enc) == G_TYPE_INT64 || + G_VALUE_TYPE(enc) == G_TYPE_DOUBLE) + { + int val = ghb_value_int(enc); + for (ii = 0; ii < len; ii++) + { + if (encoders[ii].encoder == val) + { + return encoders[ii].short_name; + } + } + } + return 0; +} + +static gint lookup_audio_lang_int(const GValue *rate) { gint ii; @@ -1281,15 +1335,15 @@ ghb_lookup_acodec_value(gint val) GValue *value = NULL; gint ii; - for (ii = 0; ii < acodec_opts.count; ii++) + for (ii = 0; ii < hb_audio_encoders_count; ii++) { - if ((int)acodec_opts.map[ii].ivalue == val) + if ((int)hb_audio_encoders[ii].encoder == val) { - value = ghb_string_value_new(acodec_opts.map[ii].shortOpt); + value = ghb_string_value_new(hb_audio_encoders[ii].short_name); return value; } } - value = ghb_string_value_new("auto"); + value = ghb_string_value_new("copy"); return value; } @@ -1644,9 +1698,9 @@ ghb_grey_combo_options(signal_user_data_t *ud) allow_6ch = acodec & ~HB_ACODEC_LAME; if (aconfig) { - acodec = ghb_allowed_passthru_mask(ud->settings, acodec); fallback = ghb_settings_combo_int(ud->settings, "AudioEncoderFallback"); - acodec = ghb_select_audio_codec(mux, aconfig, acodec, fallback); + gint copy_mask = ghb_get_copy_mask(ud->settings); + acodec = ghb_select_audio_codec(mux, aconfig, acodec, fallback, copy_mask); gint best = hb_get_best_mixdown(acodec, aconfig->in.channel_layout, 0); allow_stereo = best >= HB_AMIXDOWN_STEREO; @@ -1792,6 +1846,60 @@ video_rate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rates, gi } static void +hb_encoder_opts_set_with_mask( + GtkBuilder *builder, + const gchar *name, + hb_encoder_t *encoders, + int len, + int mask, + int neg_mask) +{ + GtkTreeIter iter; + GtkListStore *store; + gint ii; + gchar *str; + + g_debug("hb_encoder_opts_set ()\n"); + store = get_combo_box_store(builder, name); + gtk_list_store_clear(store); + for (ii = 0; ii < len; ii++) + { + if ((mask & encoders[ii].encoder) && + !(neg_mask & encoders[ii].encoder)) + { + gtk_list_store_append(store, &iter); + str = g_strdup_printf("<small>%s</small>", + encoders[ii].human_readable_name); + gtk_list_store_set(store, &iter, + 0, str, + 1, TRUE, + 2, encoders[ii].short_name, + 3, (gdouble)encoders[ii].encoder, + 4, encoders[ii].short_name, + -1); + g_free(str); + } + } +} + +static void +hb_encoder_opts_set( + GtkBuilder *builder, + const gchar *name, + hb_encoder_t *encoders, + int len) +{ + hb_encoder_opts_set_with_mask(builder, name, encoders, len, ~0, 0); +} + +static void +acodec_fallback_opts_set(GtkBuilder *builder, const gchar *name) +{ + hb_encoder_opts_set_with_mask(builder, name, hb_audio_encoders, + hb_audio_encoders_count, ~0, HB_ACODEC_PASS_FLAG); +} + +static void mix_opts_set(GtkBuilder *builder, const gchar *name) { GtkTreeIter iter; @@ -1802,14 +1910,6 @@ mix_opts_set(GtkBuilder *builder, const gchar *name) g_debug("mix_opts_set ()\n"); store = get_combo_box_store(builder, name); gtk_list_store_clear(store); - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - 0, "<small>None</small>", - 1, TRUE, - 2, "none", - 3, 0.0, - 4, "none", - -1); for (ii = 0; ii < hb_audio_mixdowns_count; ii++) { gtk_list_store_append(store, &iter); @@ -2689,6 +2789,14 @@ ghb_lookup_combo_int(const gchar *name, const GValue *gval) return lookup_audio_lang_int(gval); else if (strcmp(name, "PreferredLanguage") == 0) return lookup_audio_lang_int(gval); + else if (strcmp(name, "VideoEncoder") == 0) + return lookup_hb_encoder_int(gval, hb_video_encoders, hb_video_encoders_count); + else if (strcmp(name, "AudioEncoder") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderFallback") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderActual") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); else { return lookup_generic_int(find_combo_table(name), gval); @@ -2714,6 +2822,14 @@ ghb_lookup_combo_double(const gchar *name, const GValue *gval) return lookup_audio_lang_int(gval); else if (strcmp(name, "PreferredLanguage") == 0) return lookup_audio_lang_int(gval); + else if (strcmp(name, "VideoEncoder") == 0) + return lookup_hb_encoder_int(gval, hb_video_encoders, hb_video_encoders_count); + else if (strcmp(name, "AudioEncoder") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderFallback") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderActual") == 0) + return lookup_hb_encoder_int(gval, hb_audio_encoders, hb_audio_encoders_count); else { return lookup_generic_double(find_combo_table(name), gval); @@ -2739,6 +2855,14 @@ ghb_lookup_combo_option(const gchar *name, const GValue *gval) return lookup_audio_lang_option(gval); else if (strcmp(name, "PreferredLanguage") == 0) return lookup_audio_lang_option(gval); + else if (strcmp(name, "VideoEncoder") == 0) + return lookup_hb_encoder_option(gval, hb_video_encoders, hb_video_encoders_count); + else if (strcmp(name, "AudioEncoder") == 0) + return lookup_hb_encoder_option(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderFallback") == 0) + return lookup_hb_encoder_option(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderActual") == 0) + return lookup_hb_encoder_option(gval, hb_audio_encoders, hb_audio_encoders_count); else { return lookup_generic_option(find_combo_table(name), gval); @@ -2764,6 +2888,14 @@ ghb_lookup_combo_string(const gchar *name, const GValue *gval) return lookup_audio_lang_option(gval); else if (strcmp(name, "PreferredLanguage") == 0) return lookup_audio_lang_option(gval); + else if (strcmp(name, "VideoEncoder") == 0) + return lookup_hb_encoder_string(gval, hb_video_encoders, hb_video_encoders_count); + else if (strcmp(name, "AudioEncoder") == 0) + return lookup_hb_encoder_string(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderFallback") == 0) + return lookup_hb_encoder_string(gval, hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderActual") == 0) + return lookup_hb_encoder_string(gval, hb_audio_encoders, hb_audio_encoders_count); else { return lookup_generic_string(find_combo_table(name), gval); @@ -2809,6 +2941,9 @@ ghb_update_ui_combo_box( audio_samplerate_opts_set(ud->builder, "AudioSamplerate", hb_audio_rates, hb_audio_rates_count); video_rate_opts_set(ud->builder, "VideoFramerate", hb_video_rates, hb_video_rates_count); mix_opts_set(ud->builder, "AudioMixdown"); + hb_encoder_opts_set(ud->builder, "VideoEncoder", hb_video_encoders, hb_video_encoders_count); + hb_encoder_opts_set(ud->builder, "AudioEncoder", hb_audio_encoders, hb_audio_encoders_count); + acodec_fallback_opts_set(ud->builder, "AudioEncoderFallback"); language_opts_set(ud->builder, "SrtLanguage"); language_opts_set(ud->builder, "PreferredLanguage"); srt_codeset_opts_set(ud->builder, "SrtCodeset"); @@ -2828,9 +2963,6 @@ ghb_update_ui_combo_box( generic_opts_set(ud->builder, "PictureDetelecine", &detel_opts); generic_opts_set(ud->builder, "PictureDecomb", &decomb_opts); generic_opts_set(ud->builder, "PictureDenoise", &denoise_opts); - generic_opts_set(ud->builder, "VideoEncoder", &vcodec_opts); - small_opts_set(ud->builder, "AudioEncoder", &acodec_opts); - small_opts_set(ud->builder, "AudioEncoderFallback", &acodec_fallback_opts); small_opts_set(ud->builder, "x264_direct", &direct_opts); small_opts_set(ud->builder, "x264_b_adapt", &badapt_opts); small_opts_set(ud->builder, "x264_bpyramid", &bpyramid_opts); @@ -2850,6 +2982,12 @@ ghb_update_ui_combo_box( video_rate_opts_set(ud->builder, "VideoFramerate", hb_video_rates, hb_video_rates_count); else if (strcmp(name, "AudioMixdown") == 0) mix_opts_set(ud->builder, "AudioMixdown"); + else if (strcmp(name, "VideoEncoder") == 0) + hb_encoder_opts_set(ud->builder, "VideoEncoder", hb_video_encoders, hb_video_encoders_count); + else if (strcmp(name, "AudioEncoder") == 0) + hb_encoder_opts_set(ud->builder, "AudioEncoder", hb_audio_encoders, hb_audio_encoders_count); + else if (strcmp(name, "AudioEncoderFallback") == 0) + acodec_fallback_opts_set(ud->builder, "AudioEncoderFallback"); else if (strcmp(name, "SrtLanguage") == 0) language_opts_set(ud->builder, "SrtLanguage"); else if (strcmp(name, "PreferredLanguage") == 0) @@ -2885,6 +3023,9 @@ init_ui_combo_boxes(GtkBuilder *builder) init_combo_box(builder, "SrtCodeset"); init_combo_box(builder, "title"); init_combo_box(builder, "AudioTrack"); + init_combo_box(builder, "VideoEncoder"); + init_combo_box(builder, "AudioEncoder"); + init_combo_box(builder, "AudioEncoderFallback"); for (ii = 0; combo_name_map[ii].name != NULL; ii++) { init_combo_box(builder, combo_name_map[ii].name); @@ -4236,7 +4377,7 @@ ghb_validate_audio(signal_user_data_t *ud) asettings = ghb_array_get_nth(audio_list, ii); gint track = ghb_settings_combo_int(asettings, "AudioTrack"); gint codec = ghb_settings_combo_int(asettings, "AudioEncoder"); - if (codec == HB_ACODEC_ANY) + if (codec == HB_ACODEC_AUTO_PASS) continue; aconfig = (hb_audio_config_t *) hb_list_audio_config_item( @@ -4730,9 +4871,9 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) acodec = ghb_settings_combo_int(asettings, "AudioEncoder"); - acodec = ghb_allowed_passthru_mask(js, acodec); fallback = ghb_settings_combo_int(js, "AudioEncoderFallback"); - audio.out.codec = ghb_select_audio_codec(job->mux, aconfig, acodec, fallback); + gint copy_mask = ghb_get_copy_mask(js); + audio.out.codec = ghb_select_audio_codec(job->mux, aconfig, acodec, fallback, copy_mask); audio.out.gain = ghb_settings_get_double(asettings, "AudioTrackGain"); diff --git a/gtk/src/presets.c b/gtk/src/presets.c index bc87e9a14..8305c4ae3 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1989,8 +1989,9 @@ typedef struct static value_map_t vcodec_xlat[] = { {"MPEG-2 (FFmpeg)", "ffmpeg2"}, + {"MPEG-4 (FFmpeg)", "ffmpeg4"}, {"MPEG-4 (FFmpeg)", "ffmpeg"}, - {"MPEG-4 (XviD)", "ffmpeg"}, + {"MPEG-4 (XviD)", "ffmpeg4"}, {"H.264 (x264)", "x264"}, {"VP3 (Theora)", "theora"}, {NULL,NULL} @@ -2002,13 +2003,20 @@ static value_map_t acodec_xlat[] = {"AAC (faac)", "faac"}, {"AAC (CoreAudio)", "faac"}, {"HE-AAC (CoreAudio)", "faac"}, + {"AC3 (ffmpeg)", "ffac3"}, {"AC3 (ffmpeg)", "ac3"}, {"AC3", "ac3"}, // Backwards compatibility with mac ui + {"MP3 Passthru", "copy:mp3"}, {"MP3 Passthru", "mp3pass"}, + {"AAC Passthru", "copy:aac"}, {"AAC Passthru", "aacpass"}, + {"AC3 Passthru", "copy:ac3"}, {"AC3 Passthru", "ac3pass"}, + {"DTS Passthru", "copy:dts"}, {"DTS Passthru", "dtspass"}, + {"DTS-HD Passthru", "copy:dtshd"}, {"DTS-HD Passthru", "dtshdpass"}, + {"Auto Passthru", "copy"}, {"Auto Passthru", "auto"}, {"MP3 (lame)", "lame"}, {"Vorbis (vorbis)", "vorbis"}, |