summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-02 21:19:16 +0200
committerwm4 <wm4@nowhere>2013-10-02 21:19:16 +0200
commitef9c5300ef02427db606273ac1f461a68c6c95ec (patch)
tree2a9dcf87ac7e03e1f8aa5e9b25349e21a780dba6
parent93b712fa8ab56217da2e8a5317891f4d0df1838f (diff)
downloadmpv-ef9c5300ef02427db606273ac1f461a68c6c95ec.tar.bz2
mpv-ef9c5300ef02427db606273ac1f461a68c6c95ec.tar.xz
cosmetics: replace "CTRL" defines by enums
Because why not.
-rw-r--r--audio/decode/ad.h4
-rw-r--r--demux/demux.h18
-rw-r--r--stream/stream.h52
-rw-r--r--video/decode/vd.h10
-rw-r--r--video/filter/vf.h28
5 files changed, 61 insertions, 51 deletions
diff --git a/audio/decode/ad.h b/audio/decode/ad.h
index 1d9ac13e35..30e739d135 100644
--- a/audio/decode/ad.h
+++ b/audio/decode/ad.h
@@ -39,6 +39,8 @@ struct ad_functions {
int maxlen);
};
-#define ADCTRL_RESYNC_STREAM 1 // resync, called after seeking
+enum ad_ctrl {
+ ADCTRL_RESYNC_STREAM = 1, // resync, called after seeking
+};
#endif /* MPLAYER_AD_H */
diff --git a/demux/demux.h b/demux/demux.h
index af8766ec22..1e0546a6d0 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -55,14 +55,16 @@ enum timestamp_type {
#define DEMUXER_CTRL_OK 1
#define DEMUXER_CTRL_GUESS 2
-#define DEMUXER_CTRL_UPDATE_INFO 8
-#define DEMUXER_CTRL_SWITCHED_TRACKS 9
-#define DEMUXER_CTRL_GET_TIME_LENGTH 10
-#define DEMUXER_CTRL_GET_START_TIME 11
-#define DEMUXER_CTRL_SWITCH_AUDIO 12
-#define DEMUXER_CTRL_RESYNC 13
-#define DEMUXER_CTRL_SWITCH_VIDEO 14
-#define DEMUXER_CTRL_IDENTIFY_PROGRAM 15
+enum demux_ctrl {
+ DEMUXER_CTRL_UPDATE_INFO = 1,
+ DEMUXER_CTRL_SWITCHED_TRACKS,
+ DEMUXER_CTRL_GET_TIME_LENGTH,
+ DEMUXER_CTRL_GET_START_TIME,
+ DEMUXER_CTRL_SWITCH_AUDIO,
+ DEMUXER_CTRL_RESYNC,
+ DEMUXER_CTRL_SWITCH_VIDEO,
+ DEMUXER_CTRL_IDENTIFY_PROGRAM,
+};
#define SEEK_ABSOLUTE (1 << 0)
#define SEEK_FACTOR (1 << 1)
diff --git a/stream/stream.h b/stream/stream.h
index 49d9abcf67..651aa9a310 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -73,31 +73,33 @@ enum streamtype {
#define MAX_STREAM_PROTOCOLS 20
-#define STREAM_CTRL_GET_TIME_LENGTH 1
-#define STREAM_CTRL_SEEK_TO_CHAPTER 2
-#define STREAM_CTRL_GET_CURRENT_CHAPTER 3
-#define STREAM_CTRL_GET_NUM_CHAPTERS 4
-#define STREAM_CTRL_GET_CURRENT_TIME 5
-#define STREAM_CTRL_SEEK_TO_TIME 6
-#define STREAM_CTRL_GET_SIZE 7
-#define STREAM_CTRL_GET_ASPECT_RATIO 8
-#define STREAM_CTRL_GET_NUM_ANGLES 9
-#define STREAM_CTRL_GET_ANGLE 10
-#define STREAM_CTRL_SET_ANGLE 11
-#define STREAM_CTRL_GET_NUM_TITLES 12
-#define STREAM_CTRL_GET_LANG 13
-#define STREAM_CTRL_GET_CURRENT_TITLE 14
-#define STREAM_CTRL_GET_CACHE_SIZE 15
-#define STREAM_CTRL_GET_CACHE_FILL 16
-#define STREAM_CTRL_GET_CACHE_IDLE 17
-#define STREAM_CTRL_RECONNECT 18
-// DVD/Bluray, signal general support for GET_CURRENT_TIME etc.
-#define STREAM_CTRL_MANAGES_TIMELINE 19
-#define STREAM_CTRL_GET_START_TIME 20
-#define STREAM_CTRL_GET_CHAPTER_TIME 21
-#define STREAM_CTRL_GET_DVD_INFO 22
-#define STREAM_CTRL_SET_CONTENTS 23
-#define STREAM_CTRL_GET_METADATA 24
+enum stream_ctrl {
+ STREAM_CTRL_GET_TIME_LENGTH = 1,
+ STREAM_CTRL_SEEK_TO_CHAPTER,
+ STREAM_CTRL_GET_CURRENT_CHAPTER,
+ STREAM_CTRL_GET_NUM_CHAPTERS,
+ STREAM_CTRL_GET_CURRENT_TIME,
+ STREAM_CTRL_SEEK_TO_TIME,
+ STREAM_CTRL_GET_SIZE,
+ STREAM_CTRL_GET_ASPECT_RATIO,
+ STREAM_CTRL_GET_NUM_ANGLES,
+ STREAM_CTRL_GET_ANGLE,
+ STREAM_CTRL_SET_ANGLE,
+ STREAM_CTRL_GET_NUM_TITLES,
+ STREAM_CTRL_GET_LANG,
+ STREAM_CTRL_GET_CURRENT_TITLE,
+ STREAM_CTRL_GET_CACHE_SIZE,
+ STREAM_CTRL_GET_CACHE_FILL,
+ STREAM_CTRL_GET_CACHE_IDLE,
+ STREAM_CTRL_RECONNECT,
+ // DVD/Bluray, signal general support for GET_CURRENT_TIME etc.
+ STREAM_CTRL_MANAGES_TIMELINE,
+ STREAM_CTRL_GET_START_TIME,
+ STREAM_CTRL_GET_CHAPTER_TIME,
+ STREAM_CTRL_GET_DVD_INFO,
+ STREAM_CTRL_SET_CONTENTS,
+ STREAM_CTRL_GET_METADATA,
+};
struct stream_lang_req {
int type; // STREAM_AUDIO, STREAM_SUB
diff --git a/video/decode/vd.h b/video/decode/vd.h
index 3142151373..488f9fa061 100644
--- a/video/decode/vd.h
+++ b/video/decode/vd.h
@@ -40,10 +40,12 @@ typedef struct vd_functions
// NULL terminated array of all drivers
extern const vd_functions_t *const mpcodecs_vd_drivers[];
-#define VDCTRL_GET_PARAMS 1 // retrieve struct mp_image_params
-#define VDCTRL_RESYNC_STREAM 8 // reset decode state after seeking
-#define VDCTRL_QUERY_UNSEEN_FRAMES 9 // current decoder lag
-#define VDCTRL_REINIT_VO 10 // reinit filter/VO chain
+enum vd_ctrl {
+ VDCTRL_GET_PARAMS = 1, // retrieve struct mp_image_params
+ VDCTRL_RESYNC_STREAM, // reset decode state after seeking
+ VDCTRL_QUERY_UNSEEN_FRAMES, // current decoder lag
+ VDCTRL_REINIT_VO, // reinit filter/VO chain
+};
int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params);
diff --git a/video/filter/vf.h b/video/filter/vf.h
index f61bb8be80..9f041a79b4 100644
--- a/video/filter/vf.h
+++ b/video/filter/vf.h
@@ -94,19 +94,21 @@ typedef struct vf_seteq {
int value;
} vf_equalizer_t;
-#define VFCTRL_SEEK_RESET 1 // reset on picture and PTS discontinuities
-#define VFCTRL_QUERY_MAX_PP_LEVEL 4 // query max postprocessing level (if any)
-#define VFCTRL_SET_PP_LEVEL 5 // set postprocessing level
-#define VFCTRL_SET_EQUALIZER 6 // set color options (brightness,contrast etc)
-#define VFCTRL_GET_EQUALIZER 8 // get color options (brightness,contrast etc)
-#define VFCTRL_SCREENSHOT 14 // Take screenshot, arg is voctrl_screenshot_args
-#define VFCTRL_INIT_OSD 15 // Filter OSD renderer present?
-#define VFCTRL_SET_DEINTERLACE 18 // Set deinterlacing status
-#define VFCTRL_GET_DEINTERLACE 19 // Get deinterlacing status
-/* Hack to make the OSD state object available to vf_sub which
- * access OSD/subtitle state outside of normal OSD draw time. */
-#define VFCTRL_SET_OSD_OBJ 20
-#define VFCTRL_GET_HWDEC_INFO 21 // for hwdec filters
+enum vf_ctrl {
+ VFCTRL_SEEK_RESET = 1, // reset on picture and PTS discontinuities
+ VFCTRL_QUERY_MAX_PP_LEVEL, // query max postprocessing level (if any)
+ VFCTRL_SET_PP_LEVEL, // set postprocessing level
+ VFCTRL_SET_EQUALIZER, // set color options (brightness,contrast etc)
+ VFCTRL_GET_EQUALIZER, // get color options (brightness,contrast etc)
+ VFCTRL_SCREENSHOT, // Take screenshot, arg is voctrl_screenshot_args
+ VFCTRL_INIT_OSD, // Filter OSD renderer present?
+ VFCTRL_SET_DEINTERLACE, // Set deinterlacing status
+ VFCTRL_GET_DEINTERLACE, // Get deinterlacing status
+ /* Hack to make the OSD state object available to vf_sub which
+ * access OSD/subtitle state outside of normal OSD draw time. */
+ VFCTRL_SET_OSD_OBJ,
+ VFCTRL_GET_HWDEC_INFO, // for hwdec filters
+};
int vf_control(struct vf_instance *vf, int cmd, void *arg);