d_trellis_opts
};
+typedef struct
+{
+ int filter_id;
+ gboolean preset;
+} filter_opts_t;
+
+static filter_opts_t nlmeans_preset_opts =
+{
+ .filter_id = HB_FILTER_NLMEANS,
+ .preset = TRUE
+};
+
+static filter_opts_t nlmeans_tune_opts =
+{
+ .filter_id = HB_FILTER_NLMEANS,
+ .preset = FALSE
+};
+
+#if 0
+static filter_opts_t hqdn3d_preset_opts =
+{
+ .filter_id = HB_FILTER_HQDN3D,
+ .preset = TRUE
+};
+#endif
+
+static filter_opts_t detel_opts =
+{
+ .filter_id = HB_FILTER_DETELECINE,
+ .preset = TRUE
+};
+
+static filter_opts_t decomb_opts =
+{
+ .filter_id = HB_FILTER_DECOMB,
+ .preset = TRUE
+};
+
+static filter_opts_t deint_opts =
+{
+ .filter_id = HB_FILTER_DEINTERLACE,
+ .preset = TRUE
+};
+
typedef void (*opts_set_f)(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-typedef GhbValue* (*opt_get_f)(const gchar *name, const combo_opts_t *opts,
+ void *opts, const void* data);
+typedef GhbValue* (*opt_get_f)(const gchar *name, const void *opts,
const GhbValue *gval, GhbType type);
typedef struct
{
const gchar * name;
- combo_opts_t * opts;
+ void * opts;
opts_set_f opts_set;
opt_get_f opt_get;
} combo_name_map_t;
static void small_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void audio_bitrate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void audio_samplerate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void video_framerate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void mix_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void video_encoder_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void audio_encoder_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void acodec_fallback_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void language_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void srt_codeset_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void title_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void audio_track_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void subtitle_track_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void video_tune_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void video_profile_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void video_level_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
+ void *opts, const void* data);
static void container_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-static void deint_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-static void decomb_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-static void detel_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-static void denoise_preset_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-static void denoise_tune_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data);
-
-static GhbValue * generic_opt_get(const char *name, const combo_opts_t *opts,
+ void *opts, const void* data);
+static void filter_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *opts, const void* data);
+
+static GhbValue * generic_opt_get(const char *name, const void *opts,
const GhbValue *gval, GhbType type);
-static GhbValue * deint_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type);
-static GhbValue * decomb_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type);
-static GhbValue * detel_opt_get(const char *name, const combo_opts_t *opts,
+static GhbValue * filter_opt_get(const char *name, const void *opts,
const GhbValue *gval, GhbType type);
-static GhbValue *
-denoise_preset_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type);
-static GhbValue *
-denoise_tune_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type);
-
combo_name_map_t combo_name_map[] =
{
{
},
{
"PictureDeinterlace",
- NULL,
- deint_opts_set,
- deint_opt_get
+ &deint_opts,
+ filter_opts_set,
+ filter_opt_get
},
{
"PictureDecomb",
- NULL,
- decomb_opts_set,
- decomb_opt_get
+ &decomb_opts,
+ filter_opts_set,
+ filter_opt_get
},
{
"PictureDetelecine",
- NULL,
- detel_opts_set,
- detel_opt_get
+ &detel_opts,
+ filter_opts_set,
+ filter_opt_get
},
{
"PictureDenoiseFilter",
},
{
"PictureDenoisePreset",
- NULL,
- denoise_preset_opts_set,
- denoise_preset_opt_get
+ &nlmeans_preset_opts,
+ filter_opts_set,
+ filter_opt_get
},
{
"PictureDenoiseTune",
- NULL,
- denoise_tune_opts_set,
- denoise_tune_opt_get
+ &nlmeans_tune_opts,
+ filter_opts_set,
+ filter_opt_get
},
{
"x264_direct",
static void
audio_samplerate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
video_framerate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
}
static void
-video_encoder_opts_set(
- signal_user_data_t *ud,
- const gchar *name,
- combo_opts_t *opts,
- const void* data)
+video_encoder_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
}
static void
-audio_encoder_opts_set(
- signal_user_data_t *ud,
- const gchar *name,
- combo_opts_t *opts,
- const void* data)
+audio_encoder_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
acodec_fallback_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
mix_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
}
static void
-container_opts_set(
- signal_user_data_t *ud,
- const gchar *name,
- combo_opts_t *opts,
- const void* data)
+container_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
srt_codeset_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
language_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
title_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
video_tune_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
video_profile_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
static void
video_level_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
void
audio_track_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
const hb_title_t *title = (const hb_title_t*)data;
}
static void
-subtitle_track_opts_set(
- signal_user_data_t *ud,
- const gchar *name,
- combo_opts_t *opts,
- const void* data)
+subtitle_track_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
const hb_title_t *title = (const hb_title_t*)data;
static void
small_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *vopts, const void* data)
{
(void)data; // Silence "unused variable" warning
+ combo_opts_t *opts = (combo_opts_t*)vopts;
GtkTreeIter iter;
GtkListStore *store;
gint ii;
}
static void
-filter_opts_set(signal_user_data_t *ud, const gchar *name,
- int filter_id, int preset)
+filter_opts_set2(signal_user_data_t *ud, const gchar *name,
+ int filter_id, int preset)
{
GtkTreeIter iter;
GtkListStore *store;
}
static void
-deint_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
-{
- (void)opts; // Silence "unused variable" warning
- (void)data; // Silence "unused variable" warning
- filter_opts_set(ud, name, HB_FILTER_DEINTERLACE, 1);
-}
-
-static void
-decomb_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
-{
- (void)opts; // Silence "unused variable" warning
- (void)data; // Silence "unused variable" warning
- filter_opts_set(ud, name, HB_FILTER_DECOMB, 1);
-}
-
-static void
-detel_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
-{
- (void)opts; // Silence "unused variable" warning
- (void)data; // Silence "unused variable" warning
- filter_opts_set(ud, name, HB_FILTER_DETELECINE, 1);
-}
-
-static void
-denoise_preset_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+filter_opts_set(signal_user_data_t *ud, const gchar *name,
+ void *vopts, const void* data)
{
- (void)opts; // Silence "unused variable" warning
- (void)data; // Silence "unused variable" warning
- filter_opts_set(ud, name, HB_FILTER_NLMEANS, 1);
-}
+ filter_opts_t *opts = (filter_opts_t*)vopts;
-static void
-denoise_tune_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
-{
- (void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning
- filter_opts_set(ud, name, HB_FILTER_NLMEANS, 0);
+ filter_opts_set2(ud, name, opts->filter_id, opts->preset);
}
combo_name_map_t*
}
static GhbValue *
-generic_opt_get(const char *name, const combo_opts_t *opts,
+generic_opt_get(const char *name, const void *vopts,
const GhbValue *gval, GhbType type)
{
+ combo_opts_t *opts = (combo_opts_t*)vopts;
GhbValue *result = NULL;
switch (type)
{
}
static GhbValue *
-filter_opt_get(const char *name, const GhbValue *gval, GhbType type,
+filter_opt_get2(const char *name, const GhbValue *gval, GhbType type,
int filter_id, int preset)
{
GhbValue *result = NULL;
}
static GhbValue *
-deint_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type)
-{
- (void)opts; // Silence "unused variable" warning
- return filter_opt_get(name, gval, type, HB_FILTER_DEINTERLACE, 1);
-}
-
-static GhbValue *
-decomb_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type)
-{
- (void)opts; // Silence "unused variable" warning
- return filter_opt_get(name, gval, type, HB_FILTER_DECOMB, 1);
-}
-
-static GhbValue *
-detel_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type)
+filter_opt_get(const char *name, const void *vopts,
+ const GhbValue *gval, GhbType type)
{
- (void)opts; // Silence "unused variable" warning
- return filter_opt_get(name, gval, type, HB_FILTER_DETELECINE, 1);
-}
-
-static GhbValue *
-denoise_preset_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type)
-{
- (void)opts; // Silence "unused variable" warning
- return filter_opt_get(name, gval, type, HB_FILTER_NLMEANS, 1);
-}
-
-static GhbValue *
-denoise_tune_opt_get(const char *name, const combo_opts_t *opts,
- const GhbValue *gval, GhbType type)
-{
- (void)opts; // Silence "unused variable" warning
- return filter_opt_get(name, gval, type, HB_FILTER_NLMEANS, 0);
+ filter_opts_t *opts = (filter_opts_t*)vopts;
+ return filter_opt_get2(name, gval, type, opts->filter_id, opts->preset);
}
static GhbValue *
static void
audio_bitrate_opts_set(signal_user_data_t *ud, const gchar *name,
- combo_opts_t *opts, const void* data)
+ void *opts, const void* data)
{
(void)opts; // Silence "unused variable" warning
(void)data; // Silence "unused variable" warning