Skip to content

Commit

Permalink
Subtitles: Use VB_VBI instead of VB_GENERAL for most 608/708 logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
stichnot committed Apr 13, 2012
1 parent 6aa737c commit bc9e741
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/cc608decoder.cpp
Expand Up @@ -301,7 +301,7 @@ void CC608Decoder::FormatCCField(int tc, int field, int data)
{
case 0x00: //attribute
#if 0
LOG(VB_GENERAL, LOG_DEBUG,
LOG(VB_VBI, LOG_DEBUG,
QString("<ATTRIBUTE %1 %2>").arg(b1).arg(b2);
#endif
break;
Expand Down Expand Up @@ -359,7 +359,7 @@ void CC608Decoder::FormatCCField(int tc, int field, int data)
case 0x04: //misc
case 0x05: //misc + F
#if 0
LOG(VB_GENERAL, LOG_DEBUG,
LOG(VB_VBI, LOG_DEBUG,
QString("ccmode %1 cmd %2").arg(ccmode)
.arg(b2, 2, 16, '0'));
#endif
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/cc608reader.cpp
Expand Up @@ -177,7 +177,7 @@ int CC608Reader::Update(unsigned char *inpos)
if (subtitle.clr)
{
#if 0
LOG(VB_GENERAL, LOG_DEBUG, "erase displayed memory");
LOG(VB_VBI, LOG_DEBUG, "erase displayed memory");
#endif
ClearBuffers(false, true, streamIdx);
if (!subtitle.len)
Expand Down Expand Up @@ -259,7 +259,7 @@ int CC608Reader::Update(unsigned char *inpos)
ccbuf->push_back(tmpcc);
#if 0
if (ccbuf->size() > 4)
LOG(VB_GENERAL, LOG_DEBUG, QString("CC overflow: %1 %2 %3")
LOG(VB_VBI, LOG_DEBUG, QString("CC overflow: %1 %2 %3")
.arg(m_outputCol) .arg(m_outputRow)
.arg(m_outputText));
#endif
Expand Down Expand Up @@ -504,7 +504,7 @@ void CC608Reader::AddTextData(unsigned char *buffer, int len,

if (NumInputBuffers() >= MAXTBUFFER - 1)
{
LOG(VB_GENERAL, LOG_ERR, "AddTextData(): Text buffer overflow");
LOG(VB_VBI, LOG_ERR, "AddTextData(): Text buffer overflow");
return;
}

Expand Down
38 changes: 19 additions & 19 deletions mythtv/libs/libmythtv/cc708decoder.cpp
Expand Up @@ -41,7 +41,7 @@ void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2)
if (DTVCC_PACKET_START == cc_type)
{
#if 0
LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("CC ST data(0x%1 0x%2)")
LOG(VB_VBI, LOG_DEBUG, LOC + QString("CC ST data(0x%1 0x%2)")
.arg(data1,0,16).arg(data2,0,16));
#endif

Expand All @@ -55,7 +55,7 @@ void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2)
else if (DTVCC_PACKET_DATA == cc_type)
{
#if 0
LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("CC Ex data(0x%1 0x%2)")
LOG(VB_VBI, LOG_DEBUG, LOC + QString("CC Ex data(0x%1 0x%2)")
.arg(data1,0,16).arg(data2,0,16));
#endif

Expand Down Expand Up @@ -198,7 +198,7 @@ static void parse_cc_service_stream(CC708Reader* cc, uint service_num)
}

#if 0
LOG(VB_GENERAL, LOG_ERR,
LOG(VB_VBI, LOG_ERR,
QString("cc_ss delayed(%1) blk_start(%2) blk_size(%3)")
.arg(cc->delayed) .arg(blk_start) .arg(blk_size));
#endif
Expand Down Expand Up @@ -239,23 +239,23 @@ static void parse_cc_service_stream(CC708Reader* cc, uint service_num)
}

#if DEBUG_CC_SERVICE
LOG(VB_GENERAL, LOG_DEBUG, QString("i %1, blk_size %2").arg(i)
LOG(VB_VBI, LOG_DEBUG, QString("i %1, blk_size %2").arg(i)
.arg(blk_size));
#endif

// loop continuation check
if (old_i == i)
{
#if DEBUG_CC_SERVICE
LOG(VB_GENERAL, LOG_DEBUG, QString("old_i == i == %1").arg(i));
LOG(VB_VBI, LOG_DEBUG, QString("old_i == i == %1").arg(i));
QString msg;
for (int j = 0; j < blk_size; j++)
msg += QString("0x%1 ").arg(cc->buf[service_num][j], 0, 16);
LOG(VB_GENERAL, LOG_DEBUG, msg);
LOG(VB_VBI, LOG_DEBUG, msg);
#endif
if (blk_size - i > 10)
{
LOG(VB_GENERAL, LOG_INFO, "eia-708 decoding error...");
LOG(VB_VBI, LOG_INFO, "eia-708 decoding error...");
cc->Reset(service_num);
cc->delayed[service_num] = 0;
i = cc->buf_size[service_num];
Expand Down Expand Up @@ -287,12 +287,12 @@ static void parse_cc_service_stream(CC708Reader* cc, uint service_num)
{
if (0 != (blk_size - i))
{
LOG(VB_GENERAL, LOG_ERR, QString("buffer error i(%1) buf_size(%2)")
LOG(VB_VBI, LOG_ERR, QString("buffer error i(%1) buf_size(%2)")
.arg(i).arg(blk_size));
QString msg;
for (i=0; i < blk_size; i++)
msg += QString("0x%1 ").arg(cc->buf[service_num][i], 0, 16);
LOG(VB_GENERAL, LOG_ERR, msg);
LOG(VB_VBI, LOG_ERR, msg);
}
cc->buf_size[service_num] = 0;
}
Expand Down Expand Up @@ -491,7 +491,7 @@ static int handle_cc_c1(CC708Reader* cc, uint service_num, int i)
#if DEBUG_CC_SERVICE
else
{
LOG(VB_GENERAL, LOG_ERR, QString("handle_cc_c1: (NOT HANDLED) "
LOG(VB_VBI, LOG_ERR, QString("handle_cc_c1: (NOT HANDLED) "
"code(0x%1) i(%2) blk_size(%3)").arg(code, 2, 16, '0')
.arg(i).arg(blk_size));
}
Expand Down Expand Up @@ -569,12 +569,12 @@ static void rightsize_buf(CC708Reader* cc, uint service_num, uint block_size)
cc->buf_alloc[service_num] = (cc->buf[service_num]) ? new_alloc : 0;

#if DEBUG_CC_SERVICE_2
LOG(VB_GENERAL, LOG_DEBUG, QString("rightsize_buf: srv %1 to %1 bytes")
LOG(VB_VBI, LOG_DEBUG, QString("rightsize_buf: srv %1 to %1 bytes")
.arg(service_num) .arg(cc->buf_alloc[service_num]));
#endif
}
if (min_new_size >= cc->buf_alloc[service_num])
LOG(VB_GENERAL, LOG_ERR,
LOG(VB_VBI, LOG_ERR,
QString("buffer resize error: min_new_size=%1, buf_alloc[%2]=%3")
.arg(min_new_size)
.arg(service_num)
Expand All @@ -596,7 +596,7 @@ static void append_cc(CC708Reader* cc, uint service_num,
QString msg("append_cc: ");
for (i = 0; i < cc->buf_size[service_num]; i++)
msg += QString("0x%1").arg(cc->buf[service_num][i], 0, 16);
LOG(VB_GENERAL, LOG_DEBUG, msg);
LOG(VB_VBI, LOG_DEBUG, msg);
}
#endif
parse_cc_service_stream(cc, service_num);
Expand Down Expand Up @@ -630,11 +630,11 @@ static void parse_cc_packet(CC708Reader* cb_cbs, CaptionPacket* pkt,
.arg(srv) .arg(seq_num);
for (j = 0; j < pkt_size; j++)
msg += QString("0x%1").arg(pkt_buf[j], 0, 16);
LOG(VB_GENERAL, LOG_DEBUG, msg);
LOG(VB_VBI, LOG_DEBUG, msg);
}

if (pkt_size >= 127)
LOG(VB_GENERAL, LOG_ERR,
LOG(VB_VBI, LOG_ERR,
QString("Unexpected pkt_size=%1").arg(pkt_size));

while (off < pkt_size && pkt_buf[off])
Expand All @@ -644,15 +644,15 @@ static void parse_cc_packet(CC708Reader* cb_cbs, CaptionPacket* pkt,
block_data_offset = (0x7==service_number && block_size!=0) ?
off+2 : off+1;
#if DEBUG_CC_SERVICE_BLOCK
LOG(VB_GENERAL, LOG_DEBUG,
LOG(VB_VBI, LOG_DEBUG,
QString("service_block size(%1) num(%2) off(%3)")
.arg(block_size) .arg(service_number) .arg(block_data_offset));
#endif
if (off+2 == block_data_offset)
{
int extended_service_number = pkt_buf[off+2] & 0x3f;
#if DEBUG_CC_SERVICE_BLOCK
LOG(VB_GENERAL, LOG_DEBUG, QString("ext_svc_num(%1)")
LOG(VB_VBI, LOG_DEBUG, QString("ext_svc_num(%1)")
.arg(extended_service_number));
#endif
service_number = extended_service_number;
Expand All @@ -669,7 +669,7 @@ static void parse_cc_packet(CC708Reader* cb_cbs, CaptionPacket* pkt,
for (i=0; i<block_size; i++)
msg += QString("0x%1 ")
.arg(pkt_buf[block_data_offset+i], 0, 16);
LOG(VB_GENERAL, LOG_DEBUG, msg);
LOG(VB_VBI, LOG_DEBUG, msg);
}
#endif
append_cc(cb_cbs, service_number,
Expand All @@ -682,7 +682,7 @@ static void parse_cc_packet(CC708Reader* cb_cbs, CaptionPacket* pkt,
if (off<pkt_size) // must end in null service block, if packet is not full.
{
if (pkt_buf[off] != 0)
LOG(VB_GENERAL, LOG_ERR,
LOG(VB_VBI, LOG_ERR,
QString("CEA-708 packet error: pkt_size=%1, pkt_buf[%2]=%3")
.arg(pkt_size).arg(off).arg(pkt_buf[off]));
}
Expand Down

0 comments on commit bc9e741

Please sign in to comment.