[mythtv] [experimental patch] Teletext decoder for DVB Cards
Tj
htpc at treblid.dyndns.org
Thu Mar 17 13:27:18 UTC 2005
Tj wrote:
> Applied both patches and I got captions now.
>
> Two minor problems:
> 1) The letter "i" has an extra space, e.g. "this" becomes "thi s"..
This problem went away when I changed the captions font to SansMono..
> 2) The top teletext part (the section where you enter the teletext
> numbers, e.g. 801, etc) is still visible.
>
The strings with subtitle texts in page->data[y][0] sometimes starts
with @....% (where .... are some unknown chars).. What are these?
Control information? Do you have this as well, perhaps its just
Australia specific? Or my DVB-T (VisionPlus) specific? Is it always 10
bytes long?
This patch modified the 1st for loop in TeletextView::drawPage() to skip
@....%, and skip drawing the teletext number if it's 801 (probably this
patch only works for Australia)... With this, closed captions worked ok
on my system (no 'trash' text other than captions). would be nice if it
has a black background, still not sure how that's done yet.. Sorry the
patch is kidda scrummy (my MythTV is our TV and I can only squeeze in a
quick fix here and there during commercial breaks)...
Great work, Frank! This closed captions thing is really great (I get
teletext as well), too bad it only works in TS mode.... But that's
another issue....
Can't believe I'm not paying to use MythTV, bwah ha ha ha ha ha..
-------------- next part --------------
--- libs/libmythtv/vbidecoder.cpp 2005-03-15 22:53:48.000000000 +0800
+++ ../mythtv/libs/libmythtv/vbidecoder.cpp 2005-03-17 21:17:15.230324291 +0800
@@ -126,8 +126,10 @@
blink = false;
hold = false;
seperation = false;
-
- for (int x=0; x < m_tt_cols; ++x)
+ int x = 0;
+ if ( page->data[y][x++] == '@' )
+ while ( page->data[y][x++] != '%' && x < 11 );
+ for (; x < m_tt_cols; ++x)
{
ch = page->data[y][x];
switch(ch) {
@@ -217,14 +219,18 @@
setForegroundColor(newfgcolor);
setBackgroundColor(newbgcolor);
- drawBackground(x, y);
+ //drawBackground(x, y);
drawCharacter(x, y, ch);
}
}
out:
- drawCharacter(1, 0, m_pageinput[0]);
- drawCharacter(2, 0, m_pageinput[1]);
- drawCharacter(3, 0, m_pageinput[2]);
+ if ( !(m_pageinput[0] == '8' &&
+ m_pageinput[1] == '0' &&
+ m_pageinput[2] == '1' )) {
+ drawCharacter(1, 0, m_pageinput[0]);
+ drawCharacter(2, 0, m_pageinput[1]);
+ drawCharacter(3, 0, m_pageinput[2]);
+ }
}
void TeletextView::keyPress(enum TTKey key)
@@ -915,7 +921,7 @@
count++;
buf++;
}
- if (buf[0]==2)
+ if (buf[0]==2 || buf[0]==3)
{
// DVB Teletext
buf += 3;
More information about the mythtv-dev
mailing list