summaryrefslogtreecommitdiffstats
path: root/image_writer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-06 17:48:30 +0200
committerwm4 <wm4@nowhere>2012-08-06 17:48:30 +0200
commit5f57d276562c18ce65c47fa60f442ea427d7033e (patch)
tree95e7820e8ed3be3a3d809feb22dd236c7f1af0fc /image_writer.c
parent4de99d9c0c1451db8a11c4f8173352e932844f14 (diff)
downloadmpv-5f57d276562c18ce65c47fa60f442ea427d7033e.tar.bz2
mpv-5f57d276562c18ce65c47fa60f442ea427d7033e.tar.xz
image_writer: add option parsing
image_writer now provides its own option parsing, and screenshot.c and the mplayer frontend use it.
Diffstat (limited to 'image_writer.c')
-rw-r--r--image_writer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/image_writer.c b/image_writer.c
index 3aca95d963..750dd15426 100644
--- a/image_writer.c
+++ b/image_writer.c
@@ -51,6 +51,20 @@ const struct image_writer_opts image_writer_opts_defaults = {
.jpeg_quality = 85,
};
+#undef OPT_BASE_STRUCT
+#define OPT_BASE_STRUCT struct image_writer_opts
+
+const struct m_sub_options image_writer_conf = {
+ .opts = (m_option_t[]) {
+ OPT_INTRANGE("jpeg-quality", jpeg_quality, 0, 0, 100),
+ OPT_INTRANGE("png-compression", png_compression, 0, 0, 9),
+ OPT_STRING("filetype", filetype, 0),
+ {0},
+ },
+ .size = sizeof(struct image_writer_opts),
+ .defaults = &image_writer_opts_defaults,
+};
+
struct image_writer_ctx {
const struct image_writer_opts *opts;
const struct img_writer *writer;