summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c185
1 files changed, 0 insertions, 185 deletions
diff --git a/player/command.c b/player/command.c
index 13b5fb74df..19b78e27c3 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2879,163 +2879,6 @@ static int mp_property_cursor_autohide(void *ctx, struct m_property *prop,
return r;
}
-static int prop_stream_ctrl(struct MPContext *mpctx, int ctrl, void *arg)
-{
- if (!mpctx->demuxer || !mpctx->demuxer->extended_ctrls)
- return M_PROPERTY_UNAVAILABLE;
- int r = demux_stream_control(mpctx->demuxer, ctrl, arg);
- switch (r) {
- case STREAM_OK: return M_PROPERTY_OK;
- case STREAM_UNSUPPORTED: return M_PROPERTY_UNAVAILABLE;
- default: return M_PROPERTY_ERROR;
- }
-}
-
-static int mp_property_tv_norm(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- switch (action) {
- case M_PROPERTY_SET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_SET_NORM, *(char **)arg);
- case M_PROPERTY_SWITCH:
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_STEP_NORM, NULL);
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-static int mp_property_tv_scan(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- switch (action) {
- case M_PROPERTY_SET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_SET_SCAN, arg);
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_FLAG};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-/// TV color settings (RW)
-static int mp_property_tv_color(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- int req[2] = {(intptr_t)prop->priv};
- switch (action) {
- case M_PROPERTY_SET:
- req[1] = *(int *)arg;
- return prop_stream_ctrl(ctx, STREAM_CTRL_SET_TV_COLORS, req);
- case M_PROPERTY_GET: {
- int r = prop_stream_ctrl(ctx, STREAM_CTRL_GET_TV_COLORS, req);
- if (r == M_PROPERTY_OK)
- *(int *)arg = req[1];
- return r;
- }
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){
- .type = CONF_TYPE_INT,
- .flags = M_OPT_RANGE,
- .min = -100,
- .max = 100,
- };
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-static int mp_property_tv_freq(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- switch (action) {
- case M_PROPERTY_SET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_SET_TV_FREQ, arg);
- case M_PROPERTY_GET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_GET_TV_FREQ, arg);
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_FLOAT};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-static int mp_property_tv_channel(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- switch (action) {
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING};
- return M_PROPERTY_OK;
- case M_PROPERTY_SET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_SET_CHAN, *(char **)arg);
- case M_PROPERTY_GET:
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_GET_CHAN, arg);
- case M_PROPERTY_SWITCH: {
- struct m_property_switch_arg *sa = arg;
- int dir = sa->inc >= 0 ? 1 : -1;
- return prop_stream_ctrl(ctx, STREAM_CTRL_TV_STEP_CHAN, &dir);
- }
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-static int mp_property_dvb_channel(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- MPContext *mpctx = ctx;
- int r;
- switch (action) {
- case M_PROPERTY_SET:
- r = prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_SET_CHANNEL, arg);
- if (r == M_PROPERTY_OK && !mpctx->stop_play)
- mpctx->stop_play = PT_CURRENT_ENTRY;
- return r;
- case M_PROPERTY_SWITCH: {
- struct m_property_switch_arg *sa = arg;
- int dir = sa->inc >= 0 ? 1 : -1;
- r = prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_STEP_CHANNEL, &dir);
- if (r == M_PROPERTY_OK && !mpctx->stop_play)
- mpctx->stop_play = PT_CURRENT_ENTRY;
- return r;
- }
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = &m_option_type_intpair};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
-static int mp_property_dvb_channel_name(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- MPContext *mpctx = ctx;
- int r;
- switch (action) {
- case M_PROPERTY_SET:
- r = prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_SET_CHANNEL_NAME, arg);
- if (r == M_PROPERTY_OK && !mpctx->stop_play)
- mpctx->stop_play = PT_CURRENT_ENTRY;
- return r;
- case M_PROPERTY_SWITCH: {
- struct m_property_switch_arg *sa = arg;
- int dir = sa->inc >= 0 ? 1 : -1;
- r = prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_STEP_CHANNEL, &dir);
- if (r == M_PROPERTY_OK && !mpctx->stop_play)
- mpctx->stop_play = PT_CURRENT_ENTRY;
- return r;
- }
- case M_PROPERTY_GET: {
- return prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_GET_CHANNEL_NAME, arg);
- }
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
static int mp_property_playlist_pos_x(void *ctx, struct m_property *prop,
int action, void *arg, int base)
{
@@ -3749,19 +3592,6 @@ static const struct m_property mp_properties_base[] = {
PROPERTY_BITRATE("audio-bitrate", false, STREAM_AUDIO),
PROPERTY_BITRATE("sub-bitrate", false, STREAM_SUB),
-#define PROPERTY_TV_COLOR(name, type) \
- {name, mp_property_tv_color, (void *)(intptr_t)type}
- PROPERTY_TV_COLOR("tv-brightness", TV_COLOR_BRIGHTNESS),
- PROPERTY_TV_COLOR("tv-contrast", TV_COLOR_CONTRAST),
- PROPERTY_TV_COLOR("tv-saturation", TV_COLOR_SATURATION),
- PROPERTY_TV_COLOR("tv-hue", TV_COLOR_HUE),
- {"tv-freq", mp_property_tv_freq},
- {"tv-norm", mp_property_tv_norm},
- {"tv-scan", mp_property_tv_scan},
- {"tv-channel", mp_property_tv_channel},
- {"dvb-channel", mp_property_dvb_channel},
- {"dvb-channel-name", mp_property_dvb_channel_name},
-
{"cursor-autohide", mp_property_cursor_autohide},
{"window-minimized", mp_property_win_minimized},
@@ -5258,19 +5088,6 @@ static void cmd_show_progress(void *p)
mp_wakeup_core(mpctx);
}
-static void cmd_tv_last_channel(void *p)
-{
- struct mp_cmd_ctx *cmd = p;
- struct MPContext *mpctx = cmd->mpctx;
-
- if (!mpctx->demuxer || !mpctx->demuxer->extended_ctrls) {
- cmd->success = false;
- return;
- }
-
- demux_stream_control(mpctx->demuxer, STREAM_CTRL_TV_LAST_CHAN, NULL);
-}
-
static void cmd_track_add(void *p)
{
struct mp_cmd_ctx *cmd = p;
@@ -5905,8 +5722,6 @@ const struct mp_cmd_def mp_cmds[] = {
.abort_on_playback_end = true,
},
- { "tv-last-channel", cmd_tv_last_channel, },
-
{ "screenshot", cmd_screenshot,
{
OPT_FLAGS("flags", v.i, 0,