mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 10:02:17 +00:00
Remove teletext support
Teletext requires special OSD support. Because I can't even test teletext, I can't restore support for it. Since teletext can be considered ancient and obscure, and since it doesn't make sense to keep the remaining teletext code without being able to use it, I'm removing it.
This commit is contained in:
parent
2aef9e2ef3
commit
ebaaa41f2a
@ -263,15 +263,6 @@ keypad 7
|
||||
keypad ENTER
|
||||
Confirm choice.
|
||||
|
||||
(The following keys are used for controlling TV teletext. The data may come
|
||||
from either an analog TV source or an MPEG transport stream.)
|
||||
|
||||
X
|
||||
Switch teletext on/off.
|
||||
|
||||
Q and W
|
||||
Go to next/prev teletext page.
|
||||
|
||||
mouse control
|
||||
-------------
|
||||
|
||||
|
@ -2186,28 +2186,6 @@
|
||||
Choose the quality of the JPEG compression (< 60 recommended for full
|
||||
size).
|
||||
|
||||
tdevice=<value>
|
||||
Specify TV teletext device (example: ``/dev/vbi0``) (default: none).
|
||||
|
||||
tformat=<format>
|
||||
Specify TV teletext display format (default: 0):
|
||||
|
||||
:0: opaque
|
||||
:1: transparent
|
||||
:2: opaque with inverted colors
|
||||
:3: transparent with inverted colors
|
||||
|
||||
tpage=<100-899>
|
||||
Specify initial TV teletext page number (default: 100).
|
||||
|
||||
tlang=<-1-127>
|
||||
Specify default teletext language code (default: 0), which will be
|
||||
used as primary language until a type 28 packet is received. Useful
|
||||
when the teletext system uses a non-latin character set, but language
|
||||
codes are not transmitted via teletext type 28 packets for some
|
||||
reason. To see a list of supported language codes set this option to
|
||||
-1.
|
||||
|
||||
hidden_video_renderer (dshow only)
|
||||
Terminate stream with video renderer instead of Null renderer
|
||||
(default: off). Will help if video freezes but audio does not.
|
||||
|
1
Makefile
1
Makefile
@ -241,7 +241,6 @@ SRCS_COMMON = asxparser.c \
|
||||
libmpcodecs/ad_msadpcm.c \
|
||||
libmpcodecs/ad_pcm.c \
|
||||
libmpcodecs/dec_audio.c \
|
||||
libmpcodecs/dec_teletext.c \
|
||||
libmpcodecs/dec_video.c \
|
||||
libmpcodecs/img_format.c \
|
||||
libmpcodecs/mp_image.c \
|
||||
|
@ -141,10 +141,6 @@ const m_option_t tvopts_conf[]={
|
||||
#endif /* CONFIG_ALSA */
|
||||
#endif /* defined(CONFIG_TV_V4L2) */
|
||||
{"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{"tdevice", &stream_tv_defaults.teletext.device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{"tpage", &stream_tv_defaults.teletext.page, CONF_TYPE_INT, CONF_RANGE, 100, 899, NULL},
|
||||
{"tformat", &stream_tv_defaults.teletext.format, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
|
||||
{"tlang", &stream_tv_defaults.teletext.lang, CONF_TYPE_INT, CONF_RANGE, -1, 0x7f, NULL},
|
||||
{"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
|
||||
#ifdef CONFIG_TV_DSHOW
|
||||
{"hidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
|
107
command.c
107
command.c
@ -51,7 +51,6 @@
|
||||
#include "mixer.h"
|
||||
#include "libmpcodecs/dec_video.h"
|
||||
#include "libmpcodecs/dec_audio.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "osdep/strsep.h"
|
||||
#include "sub/vobsub.h"
|
||||
#include "sub/spudec.h"
|
||||
@ -2110,91 +2109,6 @@ static int mp_property_tv_color(m_option_t *prop, int action, void *arg,
|
||||
|
||||
#endif
|
||||
|
||||
static int mp_property_teletext_common(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
int val, result;
|
||||
int base_ioctl = prop->offset;
|
||||
/*
|
||||
for teletext's GET,SET,STEP ioctls this is not 0
|
||||
SET is GET+1
|
||||
STEP is GET+2
|
||||
*/
|
||||
if (!mpctx->demuxer || !mpctx->demuxer->teletext)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
if (!base_ioctl)
|
||||
return M_PROPERTY_ERROR;
|
||||
|
||||
switch (action) {
|
||||
case M_PROPERTY_GET:
|
||||
if (!arg)
|
||||
return M_PROPERTY_ERROR;
|
||||
result = teletext_control(mpctx->demuxer->teletext, base_ioctl, arg);
|
||||
break;
|
||||
case M_PROPERTY_SET:
|
||||
if (!arg)
|
||||
return M_PROPERTY_ERROR;
|
||||
M_PROPERTY_CLAMP(prop, *(int *) arg);
|
||||
result = teletext_control(mpctx->demuxer->teletext, base_ioctl + 1,
|
||||
arg);
|
||||
break;
|
||||
case M_PROPERTY_STEP_UP:
|
||||
case M_PROPERTY_STEP_DOWN:
|
||||
result = teletext_control(mpctx->demuxer->teletext, base_ioctl, &val);
|
||||
val += (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ?
|
||||
-1 : 1);
|
||||
result = teletext_control(mpctx->demuxer->teletext, base_ioctl + 1,
|
||||
&val);
|
||||
break;
|
||||
default:
|
||||
return M_PROPERTY_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
return result == VBI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR;
|
||||
}
|
||||
|
||||
static int mp_property_teletext_mode(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
int result;
|
||||
int val;
|
||||
|
||||
//with tvh==NULL will fail too
|
||||
result = mp_property_teletext_common(prop, action, arg, mpctx);
|
||||
if (result != M_PROPERTY_OK)
|
||||
return result;
|
||||
|
||||
if (teletext_control(mpctx->demuxer->teletext,
|
||||
prop->offset, &val) == VBI_CONTROL_TRUE && val)
|
||||
mp_input_set_section(mpctx->input, "teletext");
|
||||
else
|
||||
mp_input_set_section(mpctx->input, "tv");
|
||||
return M_PROPERTY_OK;
|
||||
}
|
||||
|
||||
static int mp_property_teletext_page(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
int result;
|
||||
int val;
|
||||
if (!mpctx->demuxer->teletext)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
switch (action) {
|
||||
case M_PROPERTY_STEP_UP:
|
||||
case M_PROPERTY_STEP_DOWN:
|
||||
//This should be handled separately
|
||||
val = (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ?
|
||||
-1 : 1);
|
||||
result = teletext_control(mpctx->demuxer->teletext,
|
||||
TV_VBI_CONTROL_STEP_PAGE, &val);
|
||||
break;
|
||||
default:
|
||||
result = mp_property_teletext_common(prop, action, arg, mpctx);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// All properties available in MPlayer.
|
||||
/** \ingroup Properties
|
||||
*/
|
||||
@ -2357,17 +2271,6 @@ static const m_option_t mp_properties[] = {
|
||||
{ "tv_hue", mp_property_tv_color, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, .offset = TV_COLOR_HUE },
|
||||
#endif
|
||||
{ "teletext_page", mp_property_teletext_page, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, 100, 899, .offset = TV_VBI_CONTROL_GET_PAGE },
|
||||
{ "teletext_subpage", mp_property_teletext_common, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, 0, 64, .offset = TV_VBI_CONTROL_GET_SUBPAGE },
|
||||
{ "teletext_mode", mp_property_teletext_mode, CONF_TYPE_FLAG,
|
||||
M_OPT_RANGE, 0, 1, .offset = TV_VBI_CONTROL_GET_MODE },
|
||||
{ "teletext_format", mp_property_teletext_common, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, 0, 3, .offset = TV_VBI_CONTROL_GET_FORMAT },
|
||||
{ "teletext_half_page", mp_property_teletext_common, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, 0, 2, .offset = TV_VBI_CONTROL_GET_HALF_PAGE },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
|
||||
@ -3356,16 +3259,6 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
||||
tv_step_chanlist((tvi_handle_t *) (mpctx->demuxer->priv));
|
||||
break;
|
||||
#endif /* CONFIG_TV */
|
||||
case MP_CMD_TV_TELETEXT_ADD_DEC:
|
||||
if (mpctx->demuxer->teletext)
|
||||
teletext_control(mpctx->demuxer->teletext, TV_VBI_CONTROL_ADD_DEC,
|
||||
&(cmd->args[0].v.s));
|
||||
break;
|
||||
case MP_CMD_TV_TELETEXT_GO_LINK:
|
||||
if (mpctx->demuxer->teletext)
|
||||
teletext_control(mpctx->demuxer->teletext, TV_VBI_CONTROL_GO_LINK,
|
||||
&(cmd->args[0].v.i));
|
||||
break;
|
||||
|
||||
case MP_CMD_SUB_LOAD:
|
||||
if (sh_video) {
|
||||
|
@ -133,9 +133,6 @@ h tv_step_channel 1
|
||||
k tv_step_channel -1
|
||||
n tv_step_norm
|
||||
u tv_step_chanlist
|
||||
X step_property teletext_mode 1
|
||||
W step_property teletext_page 1
|
||||
Q step_property teletext_page -1
|
||||
|
||||
#
|
||||
# DVDNAV
|
||||
|
@ -196,8 +196,6 @@ static const mp_cmd_t mp_cmds[] = {
|
||||
{ MP_CMD_PLAYLIST_CLEAR, "playlist_clear", },
|
||||
{ MP_CMD_RUN, "run", { ARG_STRING } },
|
||||
{ MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", { ARG_INT, ARG_INT } },
|
||||
{ MP_CMD_TV_TELETEXT_ADD_DEC, "teletext_add_dec", { ARG_STRING } },
|
||||
{ MP_CMD_TV_TELETEXT_GO_LINK, "teletext_go_link", { ARG_INT } },
|
||||
|
||||
#ifdef CONFIG_DVDNAV
|
||||
{ MP_CMD_DVDNAV, "dvdnav", { ARG_STRING } },
|
||||
|
@ -120,8 +120,6 @@ enum mp_command_type {
|
||||
MP_CMD_LOOP,
|
||||
MP_CMD_BALANCE,
|
||||
MP_CMD_SUB_SCALE,
|
||||
MP_CMD_TV_TELETEXT_ADD_DEC,
|
||||
MP_CMD_TV_TELETEXT_GO_LINK,
|
||||
MP_CMD_TV_START_SCAN,
|
||||
MP_CMD_SUB_SOURCE,
|
||||
MP_CMD_SUB_FILE,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Teletext support
|
||||
*
|
||||
* Copyright (C) 2007 Vladimir Voroshilov <voroshil@gmail.com>
|
||||
*
|
||||
* This file is part of MPlayer.
|
||||
*
|
||||
* MPlayer is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MPlayer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef MPLAYER_DEC_TELETEXT_H
|
||||
#define MPLAYER_DEC_TELETEXT_H
|
||||
|
||||
struct tt_param {
|
||||
char *device; ///< teletext device
|
||||
int format; ///< teletext display format
|
||||
int page; ///< start teletext page
|
||||
int lang; ///< primary language code
|
||||
};
|
||||
|
||||
#define VBI_CONTROL_FALSE 0
|
||||
#define VBI_CONTROL_TRUE 1
|
||||
#define VBI_CONTROL_UNKNOWN -1
|
||||
|
||||
int teletext_control(void* p, int cmd, void *arg);
|
||||
|
||||
/*
|
||||
TELETEXT controls (through teletext_control() )
|
||||
NOTE:
|
||||
_SET_ should be _GET_ +1
|
||||
_STEP_ should be _GET_ +2
|
||||
*/
|
||||
#define TV_VBI_CONTROL_GET_MODE 0x510 ///< get current mode teletext
|
||||
#define TV_VBI_CONTROL_SET_MODE 0x511 ///< on/off grab teletext
|
||||
|
||||
#define TV_VBI_CONTROL_GET_PAGE 0x513 ///< get grabbed teletext page
|
||||
#define TV_VBI_CONTROL_SET_PAGE 0x514 ///< set grab teletext page number
|
||||
#define TV_VBI_CONTROL_STEP_PAGE 0x515 ///< step grab teletext page number
|
||||
|
||||
#define TV_VBI_CONTROL_GET_SUBPAGE 0x516 ///< get grabbed teletext page
|
||||
#define TV_VBI_CONTROL_SET_SUBPAGE 0x517 ///< set grab teletext page number
|
||||
|
||||
#define TV_VBI_CONTROL_GET_FORMAT 0x519 ///< get teletext format
|
||||
#define TV_VBI_CONTROL_SET_FORMAT 0x51a ///< set teletext format
|
||||
|
||||
#define TV_VBI_CONTROL_GET_HALF_PAGE 0x51c ///< get current half page
|
||||
#define TV_VBI_CONTROL_SET_HALF_PAGE 0x51d ///< switch half page
|
||||
|
||||
#define TV_VBI_CONTROL_IS_CHANGED 0x540 ///< teletext page is changed
|
||||
#define TV_VBI_CONTROL_MARK_UNCHANGED 0x541 ///< teletext page is changed
|
||||
|
||||
#define TV_VBI_CONTROL_ADD_DEC 0x550 ///< add page number with dec
|
||||
#define TV_VBI_CONTROL_GO_LINK 0x551 ///< go link (1..6) NYI
|
||||
#define TV_VBI_CONTROL_GET_VBIPAGE 0x552 ///< get vbi_image for grabbed teletext page
|
||||
#define TV_VBI_CONTROL_RESET 0x553 ///< vbi reset
|
||||
#define TV_VBI_CONTROL_START 0x554 ///< vbi start
|
||||
#define TV_VBI_CONTROL_STOP 0x555 ///< vbi stop
|
||||
#define TV_VBI_CONTROL_DECODE_PAGE 0x556 ///< decode vbi page
|
||||
#define TV_VBI_CONTROL_GET_NETWORKNAME 0x557 ///< get current network name
|
||||
#define TV_VBI_CONTROL_DECODE_DVB 0x558 ///< decode DVB teletext
|
||||
|
||||
#define VBI_TFORMAT_TEXT 0 ///< text mode
|
||||
#define VBI_TFORMAT_BW 1 ///< black&white mode
|
||||
#define VBI_TFORMAT_GRAY 2 ///< grayscale mode
|
||||
#define VBI_TFORMAT_COLOR 3 ///< color mode (require color_spu patch!)
|
||||
|
||||
#define VBI_MAX_PAGES 0x800 ///< max sub pages number
|
||||
#define VBI_MAX_SUBPAGES 64 ///< max sub pages number
|
||||
|
||||
#define VBI_ROWS 25 ///< teletext page height in rows
|
||||
#define VBI_COLUMNS 40 ///< teletext page width in chars
|
||||
#define VBI_TIME_LINEPOS 26 ///< time line pos in page header
|
||||
|
||||
typedef
|
||||
enum{
|
||||
TT_FORMAT_OPAQUE=0, ///< opaque
|
||||
TT_FORMAT_TRANSPARENT, ///< transparent
|
||||
TT_FORMAT_OPAQUE_INV, ///< opaque with inverted colors
|
||||
TT_FORMAT_TRANSPARENT_INV ///< transparent with inverted colors
|
||||
} teletext_format;
|
||||
|
||||
typedef
|
||||
enum{
|
||||
TT_ZOOM_NORMAL=0,
|
||||
TT_ZOOM_TOP_HALF,
|
||||
TT_ZOOM_BOTTOM_HALF
|
||||
} teletext_zoom;
|
||||
|
||||
typedef struct tt_char_s{
|
||||
unsigned int unicode; ///< unicode (utf8) character
|
||||
unsigned char fg; ///< foreground color
|
||||
unsigned char bg; ///< background color
|
||||
unsigned char gfx; ///< 0-no gfx, 1-solid gfx, 2-separated gfx
|
||||
unsigned char flh; ///< 0-no flash, 1-flash
|
||||
unsigned char hidden; ///< char is hidden (for subtitle pages)
|
||||
unsigned char ctl; ///< control character
|
||||
unsigned char lng; ///< lang: 0-secondary language,1-primary language
|
||||
unsigned char raw; ///< raw character (as received from device)
|
||||
} tt_char;
|
||||
|
||||
typedef struct tt_link_s{
|
||||
int pagenum; ///< page number
|
||||
int subpagenum; ///< subpage number
|
||||
} tt_link_t;
|
||||
|
||||
typedef struct tt_page_s{
|
||||
int pagenum; ///< page number
|
||||
int subpagenum; ///< subpage number
|
||||
unsigned char primary_lang; ///< primary language code
|
||||
unsigned char secondary_lang; ///< secondary language code
|
||||
unsigned char active; ///< page is complete and ready for rendering
|
||||
unsigned char flags; ///< page flags
|
||||
unsigned char raw[VBI_ROWS*VBI_COLUMNS]; ///< page data
|
||||
struct tt_page_s* next_subpage;
|
||||
struct tt_link_s links[6];
|
||||
} tt_page;
|
||||
|
||||
#define TT_PGFL_SUPPRESS_HEADER 0x01
|
||||
#define TT_PGFL_UPDATE_INDICATOR 0x02
|
||||
#define TT_PGFL_INTERRUPTED_SEQ 0x04
|
||||
#define TT_PGFL_INHIBIT_DISPLAY 0x08
|
||||
#define TT_PGFL_NEWFLASH 0x10
|
||||
#define TT_PGFL_SUBTITLE 0x20
|
||||
#define TT_PGFL_ERASE_PAGE 0x40
|
||||
#define TT_PGFL_MAGAZINE_SERIAL 0x80
|
||||
|
||||
typedef struct tt_stream_props_s{
|
||||
int sampling_rate;
|
||||
int samples_per_line;
|
||||
int offset;
|
||||
int count[2]; ///< number of lines in first and second fields
|
||||
int interlaced; ///< vbi data are interlaced
|
||||
int bufsize; ///< required buffer size
|
||||
} tt_stream_props;
|
||||
|
||||
#endif /* MPLAYER_DEC_TELETEXT_H */
|
@ -41,7 +41,6 @@
|
||||
#include "mf.h"
|
||||
|
||||
#include "libaf/af_format.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#if MP_INPUT_BUFFER_PADDING_SIZE < FF_INPUT_BUFFER_PADDING_SIZE
|
||||
@ -417,8 +416,6 @@ void free_demuxer(demuxer_t *demuxer)
|
||||
free_demuxer_stream(demuxer->sub);
|
||||
skip_streamfree:
|
||||
free(demuxer->filename);
|
||||
if (demuxer->teletext)
|
||||
teletext_control(demuxer->teletext, TV_VBI_CONTROL_STOP, NULL);
|
||||
talloc_free(demuxer);
|
||||
}
|
||||
|
||||
|
@ -248,9 +248,6 @@ typedef struct demuxer {
|
||||
struct sh_video *v_streams[MAX_V_STREAMS];
|
||||
struct sh_sub *s_streams[MAX_S_STREAMS];
|
||||
|
||||
// teletext decoder private data, if demuxer stream contains teletext
|
||||
void *teletext;
|
||||
|
||||
struct demux_chapter *chapters;
|
||||
int num_chapters;
|
||||
|
||||
|
60
mplayer.c
60
mplayer.c
@ -81,7 +81,6 @@
|
||||
|
||||
#include "sub/sub.h"
|
||||
#include "sub/av_sub.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "cpudetect.h"
|
||||
|
||||
#ifdef CONFIG_X11
|
||||
@ -1727,14 +1726,7 @@ void update_subtitles(struct MPContext *mpctx, double refpts_tl, bool reset)
|
||||
if (vo_vobsub || timestamp >= 0)
|
||||
spudec_assemble(vo_spudec, packet, len, timestamp);
|
||||
}
|
||||
} else if (is_text_sub(type) || is_av_sub(type) || type == 'd') {
|
||||
if (type == 'd' && !d_sub->demuxer->teletext) {
|
||||
tt_stream_props tsp = { 0 };
|
||||
void *ptr = &tsp;
|
||||
if (teletext_control(NULL, TV_VBI_CONTROL_START, &ptr) ==
|
||||
VBI_CONTROL_TRUE)
|
||||
d_sub->demuxer->teletext = ptr;
|
||||
}
|
||||
} else if (is_text_sub(type) || is_av_sub(type)) {
|
||||
if (d_sub->non_interleaved)
|
||||
ds_get_next_pts(d_sub);
|
||||
|
||||
@ -1763,22 +1755,6 @@ void update_subtitles(struct MPContext *mpctx, double refpts_tl, bool reset)
|
||||
len = FFMIN(len - 2, AV_RB16(packet));
|
||||
packet += 2;
|
||||
}
|
||||
if (type == 'd') {
|
||||
if (d_sub->demuxer->teletext) {
|
||||
uint8_t *p = packet;
|
||||
p++;
|
||||
len--;
|
||||
while (len >= 46) {
|
||||
int sublen = p[1];
|
||||
if (p[0] == 2 || p[0] == 3)
|
||||
teletext_control(d_sub->demuxer->teletext,
|
||||
TV_VBI_CONTROL_DECODE_DVB, p + 2);
|
||||
p += sublen + 2;
|
||||
len -= sublen + 2;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (sh_sub && sh_sub->active) {
|
||||
sub_decode(sh_sub, mpctx->osd, packet, len, subpts_s, duration);
|
||||
continue;
|
||||
@ -1817,38 +1793,6 @@ void update_subtitles(struct MPContext *mpctx, double refpts_tl, bool reset)
|
||||
}
|
||||
}
|
||||
|
||||
static void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset)
|
||||
{
|
||||
int page_changed;
|
||||
|
||||
if (!demuxer->teletext)
|
||||
return;
|
||||
|
||||
//Also forcing page update when such ioctl is not supported or call error occured
|
||||
if (teletext_control(demuxer->teletext, TV_VBI_CONTROL_IS_CHANGED,
|
||||
&page_changed) != VBI_CONTROL_TRUE)
|
||||
page_changed = 1;
|
||||
|
||||
if (!page_changed)
|
||||
return;
|
||||
|
||||
if (teletext_control(demuxer->teletext, TV_VBI_CONTROL_GET_VBIPAGE,
|
||||
&vo_osd_teletext_page) != VBI_CONTROL_TRUE)
|
||||
vo_osd_teletext_page = NULL;
|
||||
if (teletext_control(demuxer->teletext, TV_VBI_CONTROL_GET_HALF_PAGE,
|
||||
&vo_osd_teletext_half) != VBI_CONTROL_TRUE)
|
||||
vo_osd_teletext_half = 0;
|
||||
if (teletext_control(demuxer->teletext, TV_VBI_CONTROL_GET_MODE,
|
||||
&vo_osd_teletext_mode) != VBI_CONTROL_TRUE)
|
||||
vo_osd_teletext_mode = 0;
|
||||
if (teletext_control(demuxer->teletext, TV_VBI_CONTROL_GET_FORMAT,
|
||||
&vo_osd_teletext_format) != VBI_CONTROL_TRUE)
|
||||
vo_osd_teletext_format = 0;
|
||||
vo_osd_changed(OSDTYPE_TELETEXT);
|
||||
|
||||
teletext_control(demuxer->teletext, TV_VBI_CONTROL_MARK_UNCHANGED, NULL);
|
||||
}
|
||||
|
||||
static int check_framedrop(struct MPContext *mpctx, double frame_time)
|
||||
{
|
||||
struct MPOpts *opts = &mpctx->opts;
|
||||
@ -2691,7 +2635,6 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao, bool reset_ac)
|
||||
mpctx->sh_video->pts = mpctx->d_video->pts + mpctx->video_offset;
|
||||
mpctx->video_pts = mpctx->sh_video->pts;
|
||||
update_subtitles(mpctx, mpctx->sh_video->pts, true);
|
||||
update_teletext(mpctx->sh_video, mpctx->demuxer, 1);
|
||||
}
|
||||
|
||||
if (mpctx->sh_audio && reset_ac) {
|
||||
@ -3182,7 +3125,6 @@ static void run_playloop(struct MPContext *mpctx)
|
||||
struct sh_video *sh_video = mpctx->sh_video;
|
||||
mpctx->video_pts = sh_video->pts;
|
||||
update_subtitles(mpctx, sh_video->pts, false);
|
||||
update_teletext(sh_video, mpctx->demuxer, 0);
|
||||
update_osd_msg(mpctx);
|
||||
struct vf_instance *vf = sh_video->vfilter;
|
||||
mpctx->osd->pts = mpctx->video_pts - mpctx->osd->sub_offset;
|
||||
|
@ -70,12 +70,6 @@ tv_param_t stream_tv_defaults = {
|
||||
0, //hue
|
||||
0, //saturation
|
||||
-1, //gain
|
||||
{
|
||||
NULL, //tdevice
|
||||
0, //tformat
|
||||
100, //tpage
|
||||
0, //tlang
|
||||
},
|
||||
0, //scan_autostart
|
||||
50, //scan_threshold
|
||||
0.5, //scan_period
|
||||
|
17
stream/tv.c
17
stream/tv.c
@ -43,7 +43,6 @@
|
||||
|
||||
#include "libaf/af_format.h"
|
||||
#include "libmpcodecs/img_format.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "osdep/timer.h"
|
||||
|
||||
@ -380,8 +379,6 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
|
||||
mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n");
|
||||
return 0;
|
||||
}
|
||||
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
|
||||
&tvh->tv_param->teletext);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -395,8 +392,6 @@ static int tv_set_norm_i(tvi_handle_t *tvh, int norm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
|
||||
&tvh->tv_param->teletext);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -705,10 +700,6 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
|
||||
if (!tvh->functions->init(tvh->priv)) return NULL;
|
||||
|
||||
tvh->demuxer = demuxer;
|
||||
tvh->functions->control(tvh->priv,TVI_CONTROL_VBI_INIT,
|
||||
&(tvh->tv_param->teletext.device));
|
||||
tvh->functions->control(tvh->priv,TVI_CONTROL_GET_VBI_PTR,
|
||||
&demuxer->teletext);
|
||||
|
||||
if (!open_tv(tvh)){
|
||||
tv_uninit(tvh);
|
||||
@ -850,9 +841,6 @@ no_audio:
|
||||
if(funcs->control(tvh->priv,TVI_CONTROL_VID_SET_GAIN,&tvh->tv_param->gain)!=TVI_CONTROL_TRUE)
|
||||
mp_msg(MSGT_TV,MSGL_WARN,"Unable to set gain control!\n");
|
||||
|
||||
teletext_control(demuxer->teletext,TV_VBI_CONTROL_RESET,
|
||||
&tvh->tv_param->teletext);
|
||||
|
||||
return demuxer;
|
||||
}
|
||||
|
||||
@ -863,7 +851,6 @@ static void demux_close_tv(demuxer_t *demuxer)
|
||||
tv_uninit(tvh);
|
||||
free(tvh);
|
||||
demuxer->priv=NULL;
|
||||
demuxer->teletext=NULL;
|
||||
}
|
||||
|
||||
int tv_set_color_options(tvi_handle_t *tvh, int opt, int value)
|
||||
@ -932,8 +919,6 @@ int tv_set_freq(tvi_handle_t *tvh, unsigned long freq)
|
||||
mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n",
|
||||
freq, (float)freq/16);
|
||||
}
|
||||
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
|
||||
&tvh->tv_param->teletext);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1114,8 +1099,6 @@ int tv_step_norm(tvi_handle_t *tvh)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
|
||||
&tvh->tv_param->teletext);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#ifndef MPLAYER_TV_H
|
||||
#define MPLAYER_TV_H
|
||||
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "libmpdemux/demuxer.h"
|
||||
|
||||
typedef struct tv_param_s {
|
||||
@ -65,7 +64,6 @@ typedef struct tv_param_s {
|
||||
int hue;
|
||||
int saturation;
|
||||
int gain;
|
||||
struct tt_param teletext;
|
||||
|
||||
int scan;
|
||||
int scan_threshold;
|
||||
@ -222,10 +220,6 @@ typedef struct {
|
||||
#define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */
|
||||
#define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */
|
||||
|
||||
//tvi_* ioctl (not dec_teletext.c !!!)
|
||||
#define TVI_CONTROL_VBI_INIT 0x501 ///< vbi init
|
||||
#define TVI_CONTROL_GET_VBI_PTR 0x502 ///< get teletext private pointer
|
||||
|
||||
int tv_set_color_options(tvi_handle_t *tvh, int opt, int val);
|
||||
int tv_get_color_options(tvi_handle_t *tvh, int opt, int* val);
|
||||
#define TV_COLOR_BRIGHTNESS 1
|
||||
|
@ -76,7 +76,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "libmpcodecs/img_format.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "libaf/af_format.h"
|
||||
#include "osdep/timer.h"
|
||||
|
||||
@ -201,6 +200,15 @@ typedef struct priv {
|
||||
tv_param_t* tv_param; ///< TV parameters
|
||||
} priv_t;
|
||||
|
||||
typedef struct tt_stream_props_s{
|
||||
int sampling_rate;
|
||||
int samples_per_line;
|
||||
int offset;
|
||||
int count[2]; ///< number of lines in first and second fields
|
||||
int interlaced; ///< vbi data are interlaced
|
||||
int bufsize; ///< required buffer size
|
||||
} tt_stream_props;
|
||||
|
||||
#include "tvi_def.h"
|
||||
|
||||
/**
|
||||
@ -2344,7 +2352,6 @@ static void vbi_grabber(priv_t* priv)
|
||||
buf=calloc(1,rb->blocksize);
|
||||
for(i=0; i<23 && rb->count; i++){
|
||||
memcpy(buf,rb->ringbuffer[rb->head],rb->blocksize);
|
||||
teletext_control(priv->priv_vbi,TV_VBI_CONTROL_DECODE_PAGE,&buf);
|
||||
rb->head = (rb->head + 1) % rb->buffersize;
|
||||
rb->count--;
|
||||
}
|
||||
@ -2588,20 +2595,6 @@ static HRESULT build_vbi_chain(priv_t *priv)
|
||||
if(priv->chains[2]->rbuf)
|
||||
return S_OK;
|
||||
|
||||
if(priv->tv_param->teletext.device)
|
||||
{
|
||||
priv->chains[2]->rbuf=calloc(1,sizeof(grabber_ringbuffer_t));
|
||||
if(!priv->chains[2]->rbuf)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
init_ringbuffer(priv->chains[2]->rbuf,24,priv->tsp.bufsize);
|
||||
|
||||
hr=build_sub_graph(priv, priv->chains[2],&PIN_CATEGORY_VBI);
|
||||
if(FAILED(hr)){
|
||||
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to build VBI chain of capture graph. Error:0x%x\n",(unsigned int)hr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -3012,7 +3005,6 @@ static int uninit(priv_t * priv)
|
||||
if (priv->dwRegister) {
|
||||
RemoveFromRot(priv->dwRegister);
|
||||
}
|
||||
teletext_control(priv->priv_vbi,TV_VBI_CONTROL_STOP,(void*)1);
|
||||
//stop audio grabber thread
|
||||
|
||||
if (priv->state && priv->pMediaControl) {
|
||||
@ -3517,19 +3509,6 @@ static int control(priv_t * priv, int cmd, void *arg)
|
||||
case TVI_CONTROL_IMMEDIATE:
|
||||
priv->immediate_mode = 1;
|
||||
return TVI_CONTROL_TRUE;
|
||||
case TVI_CONTROL_VBI_INIT:
|
||||
{
|
||||
void* ptr;
|
||||
ptr=&(priv->tsp);
|
||||
if(teletext_control(NULL,TV_VBI_CONTROL_START,&ptr)==VBI_CONTROL_TRUE)
|
||||
priv->priv_vbi=ptr;
|
||||
else
|
||||
priv->priv_vbi=NULL;
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
case TVI_CONTROL_GET_VBI_PTR:
|
||||
*(void **)arg=priv->priv_vbi;
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
return TVI_CONTROL_UNKNOWN;
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ known issues:
|
||||
#endif
|
||||
#include "mp_msg.h"
|
||||
#include "libmpcodecs/img_format.h"
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "libaf/af_format.h"
|
||||
#include "tv.h"
|
||||
#include "audio_in.h"
|
||||
@ -163,6 +162,15 @@ typedef struct priv {
|
||||
tv_param_t *tv_param;
|
||||
} priv_t;
|
||||
|
||||
typedef struct tt_stream_props_s{
|
||||
int sampling_rate;
|
||||
int samples_per_line;
|
||||
int offset;
|
||||
int count[2]; ///< number of lines in first and second fields
|
||||
int interlaced; ///< vbi data are interlaced
|
||||
int bufsize; ///< required buffer size
|
||||
} tt_stream_props;
|
||||
|
||||
#include "tvi_def.h"
|
||||
|
||||
static void *audio_grabber(void *data);
|
||||
@ -594,52 +602,6 @@ static int get_control(priv_t *priv, struct v4l2_control *control, int val_signe
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
|
||||
static int vbi_init(priv_t* priv,char* device)
|
||||
{
|
||||
int vbi_fd=0;
|
||||
struct v4l2_capability cap;
|
||||
struct v4l2_format fmt;
|
||||
int res;
|
||||
|
||||
if(!device)
|
||||
return TVI_CONTROL_FALSE;
|
||||
|
||||
priv->vbi_dev=strdup(device);
|
||||
|
||||
vbi_fd=open(priv->vbi_dev,O_RDWR);
|
||||
if(vbi_fd<0){
|
||||
mp_msg(MSGT_TV,MSGL_ERR,"vbi: could not open device %s\n",priv->vbi_dev);
|
||||
return TVI_CONTROL_FALSE;
|
||||
}
|
||||
|
||||
if(ioctl(vbi_fd,VIDIOC_QUERYCAP,&cap)<0){
|
||||
mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query capabilities failed for %s\n",priv->vbi_dev);
|
||||
close(vbi_fd);
|
||||
return TVI_CONTROL_FALSE;
|
||||
}
|
||||
if(!(cap.capabilities & V4L2_CAP_VBI_CAPTURE)){
|
||||
mp_msg(MSGT_TV,MSGL_ERR,"vbi: %s does not support VBI capture\n",priv->vbi_dev);
|
||||
close(vbi_fd);
|
||||
return TVI_CONTROL_FALSE;
|
||||
}
|
||||
|
||||
memset(&fmt,0,sizeof(struct v4l2_format));
|
||||
fmt.type=V4L2_BUF_TYPE_VBI_CAPTURE;
|
||||
if((res=ioctl(vbi_fd,VIDIOC_G_FMT,&fmt))<0){
|
||||
mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query format failed: %x\n",res);
|
||||
close(vbi_fd);
|
||||
return TVI_CONTROL_FALSE;
|
||||
}
|
||||
if(fmt.fmt.vbi.sample_format!=V4L2_PIX_FMT_GREY){
|
||||
mp_msg(MSGT_TV,MSGL_ERR,"vbi: format 0x%x is not supported\n",fmt.fmt.vbi.sample_format);
|
||||
close(vbi_fd);
|
||||
return TVI_CONTROL_FALSE;
|
||||
}
|
||||
priv->vbi_fd=vbi_fd;
|
||||
mp_msg(MSGT_TV,MSGL_DBG3,"vbi: init ok\n");
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
|
||||
static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp)
|
||||
{
|
||||
struct v4l2_format fmt;
|
||||
@ -710,7 +672,6 @@ static void *vbi_grabber(void *data)
|
||||
seq=0;
|
||||
}
|
||||
prev_seq=seq;
|
||||
teletext_control(priv->priv_vbi,TV_VBI_CONTROL_DECODE_PAGE,&buf);
|
||||
mp_msg(MSGT_TV,MSGL_DBG3,"grabber: seq:%d\n",seq);
|
||||
}
|
||||
free(buf);
|
||||
@ -1034,26 +995,6 @@ static int control(priv_t *priv, int cmd, void *arg)
|
||||
if (audio_in_set_samplerate(&priv->audio_in, *(int*)arg) < 0) return TVI_CONTROL_FALSE;
|
||||
// setup_audio_buffer_sizes(priv);
|
||||
return TVI_CONTROL_TRUE;
|
||||
case TVI_CONTROL_VBI_INIT:
|
||||
{
|
||||
void* ptr;
|
||||
tt_stream_props tsp;
|
||||
|
||||
if (vbi_init(priv,*(char**)arg)!=TVI_CONTROL_TRUE)
|
||||
return TVI_CONTROL_FALSE;
|
||||
if(vbi_get_props(priv,&tsp)==TVI_CONTROL_TRUE)
|
||||
{
|
||||
ptr=&tsp;
|
||||
if(teletext_control(NULL,TV_VBI_CONTROL_START,&ptr)==VBI_CONTROL_TRUE)
|
||||
priv->priv_vbi=ptr;
|
||||
else
|
||||
priv->priv_vbi=NULL;
|
||||
}
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
case TVI_CONTROL_GET_VBI_PTR:
|
||||
*(void **)arg=priv->priv_vbi;
|
||||
return TVI_CONTROL_TRUE;
|
||||
}
|
||||
mp_msg(MSGT_TV, MSGL_V, "%s: unknown control: %d\n", info.short_name, cmd);
|
||||
return TVI_CONTROL_UNKNOWN;
|
||||
@ -1103,7 +1044,6 @@ static int uninit(priv_t *priv)
|
||||
if(priv->vbi_grabber_thread)
|
||||
pthread_join(priv->vbi_grabber_thread, NULL);
|
||||
|
||||
teletext_control(priv->priv_vbi,TV_VBI_CONTROL_STOP,(void*)1);
|
||||
priv->priv_vbi=NULL;
|
||||
|
||||
if(priv->vbi_fd){
|
||||
|
@ -10,10 +10,6 @@ void vo_update_text_osd(struct osd_state *osd, mp_osd_obj_t *obj)
|
||||
{
|
||||
}
|
||||
|
||||
void vo_update_text_teletext(struct osd_state *osd, mp_osd_obj_t *obj)
|
||||
{
|
||||
}
|
||||
|
||||
void vo_update_text_progbar(struct osd_state *osd, mp_osd_obj_t *obj)
|
||||
{
|
||||
}
|
||||
|
@ -361,16 +361,6 @@ void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj)
|
||||
talloc_free(text);
|
||||
}
|
||||
|
||||
// Unimplemented.
|
||||
void vo_update_text_teletext(struct osd_state *osd, mp_osd_obj_t *obj)
|
||||
{
|
||||
obj->flags |= OSDFLAG_CHANGED;
|
||||
obj->flags &= ~OSDFLAG_VISIBLE;
|
||||
if (!vo_osd_teletext_page || !vo_osd_teletext_mode)
|
||||
return;
|
||||
mp_msg(MSGT_OSD, MSGL_ERR, "OSD: teletext rendering not implemented\n");
|
||||
}
|
||||
|
||||
// unneeded
|
||||
void osd_font_invalidate(void) {}
|
||||
void osd_font_load(struct osd_state *osd) {}
|
||||
|
10
sub/sub.c
10
sub/sub.c
@ -29,7 +29,6 @@
|
||||
#include "stream/stream_dvdnav.h"
|
||||
#define OSD_NAV_BOX_ALPHA 0x7f
|
||||
|
||||
#include "libmpcodecs/dec_teletext.h"
|
||||
#include "osdep/timer.h"
|
||||
|
||||
#include "talloc.h"
|
||||
@ -57,10 +56,6 @@ char * const sub_osd_names[]={
|
||||
};
|
||||
char * const sub_osd_names_short[] ={ "", "|>", "||", "[]", "<<" , ">>", "", "", "", "", "", "", "" };
|
||||
|
||||
void* vo_osd_teletext_page=NULL;
|
||||
int vo_osd_teletext_half = 0;
|
||||
int vo_osd_teletext_mode=0;
|
||||
int vo_osd_teletext_format=0;
|
||||
int sub_unicode=0;
|
||||
int sub_utf8=0;
|
||||
int sub_pos=100;
|
||||
@ -250,9 +245,6 @@ static int osd_update_ext(struct osd_state *osd, int dxs, int dys,
|
||||
case OSDTYPE_SUBTITLE:
|
||||
vo_update_text_sub(osd, obj);
|
||||
break;
|
||||
case OSDTYPE_TELETEXT:
|
||||
vo_update_text_teletext(osd, obj);
|
||||
break;
|
||||
case OSDTYPE_PROGBAR:
|
||||
vo_update_text_progbar(osd, obj);
|
||||
break;
|
||||
@ -330,7 +322,6 @@ struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib)
|
||||
#ifdef CONFIG_DVDNAV
|
||||
new_osd_obj(OSDTYPE_DVDNAV);
|
||||
#endif
|
||||
new_osd_obj(OSDTYPE_TELETEXT);
|
||||
osd_font_invalidate();
|
||||
osd->osd_text = talloc_strdup(osd, "");
|
||||
osd_init_backend(osd);
|
||||
@ -369,7 +360,6 @@ void osd_draw_text_ext(struct osd_state *osd, int dxs, int dys,
|
||||
#ifdef CONFIG_DVDNAV
|
||||
case OSDTYPE_DVDNAV:
|
||||
#endif
|
||||
case OSDTYPE_TELETEXT:
|
||||
case OSDTYPE_OSD:
|
||||
case OSDTYPE_SUBTITLE:
|
||||
case OSDTYPE_PROGBAR:
|
||||
|
@ -30,7 +30,6 @@ typedef struct mp_osd_bbox_s {
|
||||
#define OSDTYPE_PROGBAR 3
|
||||
#define OSDTYPE_SPU 4
|
||||
#define OSDTYPE_DVDNAV 5
|
||||
#define OSDTYPE_TELETEXT 6
|
||||
|
||||
#define OSDFLAG_VISIBLE 1
|
||||
#define OSDFLAG_CHANGED 2
|
||||
@ -90,11 +89,6 @@ struct osd_state {
|
||||
|
||||
extern subtitle* vo_sub;
|
||||
|
||||
extern void* vo_osd_teletext_page;
|
||||
extern int vo_osd_teletext_half;
|
||||
extern int vo_osd_teletext_mode;
|
||||
extern int vo_osd_teletext_format;
|
||||
|
||||
extern int vo_osd_progbar_type;
|
||||
extern int vo_osd_progbar_value; // 0..255
|
||||
|
||||
@ -192,7 +186,6 @@ void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(void *ctx, in
|
||||
|
||||
// defined in osd_ft.c or osd_libass.c
|
||||
void vo_update_text_osd(struct osd_state *osd, mp_osd_obj_t *obj);
|
||||
void vo_update_text_teletext(struct osd_state *osd, mp_osd_obj_t *obj);
|
||||
void vo_update_text_progbar(struct osd_state *osd, mp_osd_obj_t *obj);
|
||||
void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t *obj);
|
||||
void osd_get_function_sym(char *buffer, size_t buffer_size, int osd_function);
|
||||
|
Loading…
Reference in New Issue
Block a user