summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-09-13 17:16:18 +0200
committerwm4 <wm4@nowhere>2019-09-13 17:32:19 +0200
commitb30e85508a305d668db8419556d295a65ab08707 (patch)
treefa48444a183c97fd5081aa0206c5adece43eaf32 /player
parent162e0f5ad92116d1a4fb740d087da2a152686b73 (diff)
downloadmpv-b30e85508a305d668db8419556d295a65ab08707.tar.bz2
mpv-b30e85508a305d668db8419556d295a65ab08707.tar.xz
Remove classic Linux analog TV support, and DVB runtime controls
Linux analog TV support (via tv://) was excessively complex, and whenever I attempted to use it (cameras or loopback devices), it didn't work well, or would have required some major work to update it. It's very much stuck in the analog past (my favorite are the frequency tables in frequencies.c for analog TV channels which don't exist anymore). Especially cameras and such work fine with libavdevice and better than tv://, for example: mpv av://v4l2:/dev/video0 (adding --profile=low-latency --untimed even makes it mostly realtime) Adding a new input layer that targets such "modern" uses would be acceptable, if anyone is interested in it. The old TV code is just too focused on actual analog TV. DVB is rather obscure, but has an active maintainer, so don't remove it. However, the demux/stream ctrl layer must go, so remove controls for channel switching. Most of these could be reimplemented by using the normal method for option runtime changes.
Diffstat (limited to 'player')
-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,