options: move dvd options to stream_dvdnav

The options and struct are only used in stream_dvdnav.c.
Also use dvd prefix for dvd_conf.
This commit is contained in:
nanahi 2024-11-14 12:53:05 -05:00 committed by Kacper Michajłow
parent 354ad7f27d
commit 9543426889
3 changed files with 24 additions and 24 deletions

View File

@ -88,6 +88,8 @@ extern const struct m_obj_list vo_obj_list;
extern const struct m_sub_options ao_conf; extern const struct m_sub_options ao_conf;
extern const struct m_sub_options dvd_conf;
extern const struct m_sub_options opengl_conf; extern const struct m_sub_options opengl_conf;
extern const struct m_sub_options vulkan_conf; extern const struct m_sub_options vulkan_conf;
extern const struct m_sub_options vulkan_display_conf; extern const struct m_sub_options vulkan_display_conf;
@ -420,22 +422,6 @@ const struct m_sub_options cuda_conf = {
}, },
}; };
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct dvd_opts
const struct m_sub_options dvd_conf = {
.opts = (const struct m_option[]){
{"dvd-device", OPT_STRING(device), .flags = M_OPT_FILE},
{"dvd-speed", OPT_INT(speed)},
{"dvd-angle", OPT_INT(angle), M_RANGE(1, 99)},
{0}
},
.size = sizeof(struct dvd_opts),
.defaults = &(const struct dvd_opts){
.angle = 1,
},
};
#undef OPT_BASE_STRUCT #undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct filter_opts #define OPT_BASE_STRUCT struct filter_opts
@ -556,7 +542,7 @@ static const m_option_t mp_opts[] = {
// ------------------------- stream options -------------------- // ------------------------- stream options --------------------
#if HAVE_DVDNAV #if HAVE_DVDNAV
{"", OPT_SUBSTRUCT(dvd_opts, dvd_conf)}, {"dvd", OPT_SUBSTRUCT(dvd_opts, dvd_conf)},
#endif #endif
{"edition", OPT_CHOICE(edition_id, {"auto", -1}), M_RANGE(0, 8190)}, {"edition", OPT_CHOICE(edition_id, {"auto", -1}), M_RANGE(0, 8190)},
#if HAVE_LIBBLURAY #if HAVE_LIBBLURAY

View File

@ -390,12 +390,6 @@ struct cuda_opts {
int cuda_device; int cuda_device;
}; };
struct dvd_opts {
int angle;
int speed;
char *device;
};
struct filter_opts { struct filter_opts {
int deinterlace; int deinterlace;
int field_parity; int field_parity;
@ -403,7 +397,6 @@ struct filter_opts {
extern const struct m_sub_options vo_sub_opts; extern const struct m_sub_options vo_sub_opts;
extern const struct m_sub_options cuda_conf; extern const struct m_sub_options cuda_conf;
extern const struct m_sub_options dvd_conf;
extern const struct m_sub_options mp_subtitle_sub_opts; extern const struct m_sub_options mp_subtitle_sub_opts;
extern const struct m_sub_options mp_subtitle_shared_sub_opts; extern const struct m_sub_options mp_subtitle_shared_sub_opts;
extern const struct m_sub_options mp_osd_render_sub_opts; extern const struct m_sub_options mp_osd_render_sub_opts;

View File

@ -72,6 +72,27 @@ struct priv {
struct dvd_opts *opts; struct dvd_opts *opts;
}; };
struct dvd_opts {
int angle;
int speed;
char *device;
};
#define OPT_BASE_STRUCT struct dvd_opts
const struct m_sub_options dvd_conf = {
.opts = (const struct m_option[]){
{"device", OPT_STRING(device), .flags = M_OPT_FILE},
{"speed", OPT_INT(speed)},
{"angle", OPT_INT(angle), M_RANGE(1, 99)},
{0}
},
.size = sizeof(struct dvd_opts),
.defaults = &(const struct dvd_opts){
.angle = 1,
},
};
#define DNE(e) [e] = # e #define DNE(e) [e] = # e
static const char *const mp_dvdnav_events[] = { static const char *const mp_dvdnav_events[] = {
DNE(DVDNAV_BLOCK_OK), DNE(DVDNAV_BLOCK_OK),