From 38450fcb8a6086f668e3ec4d9c46aa38c25ec897 Mon Sep 17 00:00:00 2001 From: Yan Yan Date: Wed, 06 Dec 2017 14:41:48 +0000 Subject: ATVCC: Add flash support, add a vbi info updater PD# none Change-Id: I33d45b152a06a2ca44fc4d5749e4fd8aeaf14765 --- diff --git a/src/caption.c b/src/caption.c index 343f9c1..407bea8 100644 --- a/src/caption.c +++ b/src/caption.c @@ -814,7 +814,7 @@ int i; vbi_char *acp = ch->line - ch->pg[ch->hidden].text + ch->pg[ch->hidden^1].text; memcpy(acp, ch->line, sizeof(*acp) * COLUMNS); - render(ch->pg + 1, ch->row); + render(&ch->pg[ch->hidden^1], ch->row); #if 0 AM_DEBUG(1,"+++ Display line"); for (i=0;imutex); - AM_DEBUG(1, "vbi_data: line: %d %x %x", line, buf[0], buf[1]); + //AM_DEBUG(1, "vbi_data: line: %d %x %x", line, buf[0], buf[1]); if (line == 21) { cc->curr_chan = cc->curr_chan_f1; @@ -1762,6 +1762,35 @@ vbi_fetch_cc_page(vbi_decoder *vbi, vbi_page *pg, vbi_pgno pgno, vbi_bool reset) return 1; } +void vbi_refresh_cc(vbi_decoder *vbi) +{ + cc_channel *ch; + vbi_page *spg; + int i, j; + int flash_flag = 0; + vbi_event event; + pthread_mutex_lock(&vbi->cc.mutex); + for (i = 0; i < 8; i++) + { + flash_flag = 0; + ch = &vbi->cc.channel[i]; + spg = ch->pg + (ch->hidden ^ 1); + for (j = 0; j < sizeof(spg->text)/sizeof(vbi_char); j++) + { + if (spg->text[j].flash) + { + flash_flag = 1; + break; + } + } + if (flash_flag) + { + update(ch); + } + } + pthread_mutex_unlock(&vbi->cc.mutex); +} + /* Local variables: c-set-style: K&R -- cgit