summaryrefslogtreecommitdiff
authoryan yan <yan.yan@amlogic.com>2017-12-08 10:41:21 (GMT)
committer yan yan <yan.yan@amlogic.com>2017-12-08 11:49:02 (GMT)
commitb83ed7487e1ba31fcd1af454d7ae47f3db220980 (patch)
tree3b5e25455e05ba786f2394af27db3b327dc423e4
parent90305affd4fbe187cf27de5874e8fdbf8591d866 (diff)
downloadlibzvbi-b83ed7487e1ba31fcd1af454d7ae47f3db220980.zip
libzvbi-b83ed7487e1ba31fcd1af454d7ae47f3db220980.tar.gz
libzvbi-b83ed7487e1ba31fcd1af454d7ae47f3db220980.tar.bz2
ATVCC: ATVCC: The space precede the background attribute code now can be
set to appropriate background color. [1/1] PD# NONE Change-Id: I6307879cd1a97c67cc4614a64815f4f18c1cbbfb
Diffstat
-rw-r--r--src/caption.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/caption.c b/src/caption.c
index 9c823de..23699d9 100644
--- a/src/caption.c
+++ b/src/caption.c
@@ -944,6 +944,7 @@ caption_command(vbi_decoder *vbi, struct caption *cc,
{
XDS_SEP_DEBUG("caption_command\n");
cc_channel *ch;
+ vbi_char *c;
int chan, col, i;
int last_row;
chan = (cc->curr_chan & 4) + field2 * 2 + ((c1 >> 3) & 1);
@@ -1015,10 +1016,25 @@ caption_command(vbi_decoder *vbi, struct caption *cc,
}
switch (c1) {
- case 0: /* Optional Attributes 001 c000 010 xxxt */
-// not verified
+ case 0:
+ /* Optional Attributes 001 c000 010 xxxt */
ch->attr.opacity = (c2 & 1) ? VBI_SEMI_TRANSPARENT : VBI_OPAQUE;
ch->attr.background = palette_mapping[(c2 >> 1) & 7];
+ //AM_DEBUG(1, "background_set %x %x %x", ch->line[ch->col].unicode, ch->line[ch->col-1].unicode, ch->line[ch->col-2].unicode);
+ for (i=0; i<2 && ((ch->col - i) >= 0); i++)
+ {
+ if (ch->col < COLUMNS - 1)
+ c = &ch->line[ch->col - i];
+ else {
+ /* line break here? */
+ c = &ch->line[COLUMNS - 2 - i];
+ }
+ if (c->unicode == 0x20)
+ {
+ c->background = ch->attr.background;
+ c->opacity = ch->attr.opacity;
+ }
+ }
return;
case 1:
@@ -1063,7 +1079,7 @@ caption_command(vbi_decoder *vbi, struct caption *cc,
case 3:
/* Send specs to the maintainer of this code */
{
- vbi_char c;
+ vbi_char c;
c = ch->attr;
c.unicode = vbi_caption_unicode((c1 << 8) | c2 | 0x1000, 0);