diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 11:31:47 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 11:31:47 +0000 |
commit | 9a8a73e547dd662bce82cfe52fde37dd7409f1d2 (patch) | |
tree | b6dd51d6090a0a23b7f8675ad94645980eae8b24 /libmpcodecs/dec_teletext.c | |
parent | 1135e23dfc98a161a4da78519fa200f2c982a064 (diff) | |
download | mpv-9a8a73e547dd662bce82cfe52fde37dd7409f1d2.tar.bz2 mpv-9a8a73e547dd662bce82cfe52fde37dd7409f1d2.tar.xz |
Add support for DVB teletext.
Patch by Francesco Lavra [francescolavra interfree it] with modifications by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29875 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/dec_teletext.c')
-rw-r--r-- | libmpcodecs/dec_teletext.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libmpcodecs/dec_teletext.c b/libmpcodecs/dec_teletext.c index d063860fd6..5be9812086 100644 --- a/libmpcodecs/dec_teletext.c +++ b/libmpcodecs/dec_teletext.c @@ -1537,6 +1537,29 @@ static void vbi_decode(priv_vbi_t* priv,unsigned char*buf){ } +/** + * \brief decodes a vbi line from a DVB teletext stream + * \param priv private data structure + * \param buf buffer with DVB teletext data + * + * No locking is done since this is only called from a single-threaded context + */ +static void vbi_decode_dvb(priv_vbi_t *priv, const uint8_t buf[44]){ + int i; + uint8_t data[42]; + + mp_msg(MSGT_TELETEXT,MSGL_DBG3, "vbi: vbi_decode_dvb\n"); + + /* Reverse bit order, skipping the first two bytes (field parity, line + offset and framing code). */ + for (i = 0; i < sizeof(data); i++) + data[i] = av_reverse[buf[2 + i]]; + + vbi_decode_line(priv, data); + if (priv->cache_reset) + priv->cache_reset--; +} + /* --------------------------------------------------------------------------------- Public routines @@ -1846,6 +1869,9 @@ int teletext_control(void* p, int cmd, void *arg) case TV_VBI_CONTROL_DECODE_PAGE: vbi_decode(priv,*(unsigned char**)arg); return VBI_CONTROL_TRUE; + case TV_VBI_CONTROL_DECODE_DVB: + vbi_decode_dvb(priv, arg); + return VBI_CONTROL_TRUE; case TV_VBI_CONTROL_GET_VBIPAGE: if(!priv->on) return VBI_CONTROL_FALSE; |