diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp index e23f68654de..7acc8cab477 100644 --- a/mythtv/libs/libmythtv/cardutil.cpp +++ b/mythtv/libs/libmythtv/cardutil.cpp @@ -90,7 +90,7 @@ QString CardUtil::GetScanableCardTypes(void) bool CardUtil::IsTunerShared(uint cardidA, uint cardidB) { - VERBOSE(VB_IMPORTANT, QString("IsTunerShared(%1,%2)") + LOG(VB_GENERAL, LOG_DEBUG, QString("IsTunerShared(%1,%2)") .arg(cardidA).arg(cardidB)); MSqlQuery query(MSqlQuery::InitCon()); @@ -124,7 +124,7 @@ bool CardUtil::IsTunerShared(uint cardidA, uint cardidB) (hostname == query.value(1).toString()) && (cardtype == query.value(2).toString())); - VERBOSE(VB_RECORD, QString("IsTunerShared(%1,%2) -> %3") + LOG(VB_RECORD, LOG_DEBUG, QString("IsTunerShared(%1,%2) -> %3") .arg(cardidA).arg(cardidB).arg(ret)); return ret; @@ -296,15 +296,14 @@ QStringList CardUtil::ProbeVideoDevices(const QString &rawtype) if (result == -1) { - VERBOSE(VB_IMPORTANT, "CardUtil::ProbeVideoDevices: " - "Error finding HDHomerun devices"); + LOG(VB_GENERAL, LOG_ERR, "Error finding HDHomerun devices"); return devs; } if (result >= max_count) { - VERBOSE(VB_IMPORTANT, "CardUtil::ProbeVideoDevices: " - "Warning: may be > 50 HDHomerun devices"); + LOG(VB_GENERAL, LOG_WARNING, + "Warning: may be > 50 HDHomerun devices"); } // Return "deviceid ipaddress" pairs @@ -319,7 +318,8 @@ QStringList CardUtil::ProbeVideoDevices(const QString &rawtype) for (int tuner = 0; tuner < result_list[i].tuner_count; tuner++) { - QString hdhrdev = id.toUpper() + " " + ip + " " + QString("%1").arg(tuner); + QString hdhrdev = id.toUpper() + " " + ip + " " + + QString("%1").arg(tuner); devs.push_back(hdhrdev); } } @@ -327,8 +327,8 @@ QStringList CardUtil::ProbeVideoDevices(const QString &rawtype) #endif // USING_HDHOMERUN else { - VERBOSE(VB_IMPORTANT, QString("CardUtil::ProbeVideoDevices: ") + - QString("Raw Type: '%1' is not supported").arg(rawtype)); + LOG(VB_GENERAL, LOG_ERR, QString("Raw Type: '%1' is not supported") + .arg(rawtype)); } return devs; @@ -347,7 +347,7 @@ QString CardUtil::ProbeDVBType(const QString &device) int fd_frontend = open(dev.constData(), O_RDONLY | O_NONBLOCK); if (fd_frontend < 0) { - VERBOSE(VB_IMPORTANT, QString("Can't open DVB frontend (%1) for %2.") + LOG(VB_GENERAL, LOG_ERR, QString("Can't open DVB frontend (%1) for %2.") .arg(dvbdev).arg(device)); return ret; } @@ -357,7 +357,7 @@ QString CardUtil::ProbeDVBType(const QString &device) if (err < 0) { close(fd_frontend); - VERBOSE(VB_IMPORTANT, "FE_GET_INFO ioctl failed (" + dvbdev + ")."); + LOG(VB_GENERAL, LOG_ERR, "FE_GET_INFO ioctl failed (" + dvbdev + ")."); return ret; } close(fd_frontend); @@ -602,7 +602,7 @@ static uint clone_capturecard(uint src_cardid, uint orig_dst_cardid) if (!query.next()) { - VERBOSE(VB_IMPORTANT, "clone_capturecard -- get temp id"); + LOG(VB_GENERAL, LOG_ERR, "clone_capturecard -- get temp id"); return 0; } @@ -625,7 +625,7 @@ static uint clone_capturecard(uint src_cardid, uint orig_dst_cardid) } if (!query.next()) { - VERBOSE(VB_IMPORTANT, "clone_cardinput -- get data 2"); + LOG(VB_GENERAL, LOG_ERR, "clone_cardinput -- get data 2"); return 0; } @@ -696,7 +696,7 @@ static bool clone_cardinputs(uint src_cardid, uint dst_cardid) } if (!query.next()) { - VERBOSE(VB_IMPORTANT, "clone_cardinput -- get data 2"); + LOG(VB_GENERAL, LOG_ERR, "clone_cardinput -- get data 2"); ok = false; break; } @@ -793,7 +793,7 @@ static bool clone_cardinputs(uint src_cardid, uint dst_cardid) } if (!query2.next()) { - VERBOSE(VB_IMPORTANT, "clone_cardinput -- insert failed"); + LOG(VB_GENERAL, LOG_ERR, "clone_cardinput -- insert failed"); ok = false; break; } @@ -1224,15 +1224,14 @@ bool CardUtil::DeleteOrphanInputs(void) uint inputid = query.value(0).toUInt(); if (DeleteInput(inputid)) { - VERBOSE(VB_IMPORTANT, QString("DeleteOrphanInputs -- ") + - QString("Removed orphan input %1").arg(inputid)); + LOG(VB_GENERAL, LOG_NOTICE, QString("Removed orphan input %1") + .arg(inputid)); } else { ok = false; - VERBOSE(VB_IMPORTANT, QString("DeleteOrphanInputs -- ") + - QString("Failed to remove orphan input %1") - .arg(inputid)); + LOG(VB_GENERAL, LOG_ERR, QString("Failed to remove orphan input %1") + .arg(inputid)); } } @@ -1288,7 +1287,7 @@ bool CardUtil::CreateInputGroupIfNeeded(uint cardid) } if (!id) { - VERBOSE(VB_IMPORTANT, "Failed to create input group"); + LOG(VB_GENERAL, LOG_ERR, "Failed to create input group"); return false; } @@ -1297,7 +1296,7 @@ bool CardUtil::CreateInputGroupIfNeeded(uint cardid) ok &= CardUtil::LinkInputGroup(inputs[i], id); if (!ok) - VERBOSE(VB_IMPORTANT, "Failed to link to new input group"); + LOG(VB_GENERAL, LOG_ERR, "Failed to link to new input group"); return ok; } @@ -1458,8 +1457,8 @@ vector CardUtil::GetConflictingCards(uint inputid, uint exclude_cardid) for (uint i = 0; i < inputgroupids.size(); i++) { - VERBOSE(VB_RECORD, LOC + - QString(" Group ID %1").arg(inputgroupids[i])); + LOG(VB_RECORD, LOG_INFO, QString(" Group ID %1") + .arg(inputgroupids[i])); } vector cardids; @@ -1479,7 +1478,7 @@ vector CardUtil::GetConflictingCards(uint inputid, uint exclude_cardid) } for (uint i = 0; i < cardids.size(); i++) - VERBOSE(VB_RECORD, LOC + QString(" Card ID %1").arg(cardids[i])); + LOG(VB_RECORD, LOG_INFO, QString(" Card ID %1").arg(cardids[i])); return cardids; } @@ -1623,7 +1622,7 @@ InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok) if (ioctl(videofd, VIDIOCGCAP, &vidcap) != 0) { QString msg = QObject::tr("Could not query inputs."); - VERBOSE(VB_IMPORTANT, "ProbeV4LVideoInputs(): Error, " + msg + ENO); + LOG(VB_GENERAL, LOG_ERR, "ProbeV4LVideoInputs(): Error, " + msg + ENO); list[-1] = msg; vidcap.channels = 0; } @@ -1636,7 +1635,7 @@ InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok) if (ioctl(videofd, VIDIOCGCHAN, &test) != 0) { - VERBOSE(VB_IMPORTANT, "ProbeV4LVideoInputs(): Error, " + + LOG(VB_GENERAL, LOG_ERR, "ProbeV4LVideoInputs(): Error, " + QString("Could determine name of input #%1" "\n\t\t\tNot adding it to the list.") .arg(test.channel) + ENO); @@ -1727,7 +1726,8 @@ QStringList CardUtil::ProbeVideoInputs(QString device, QString cardtype) QStringList CardUtil::ProbeAudioInputs(QString device, QString cardtype) { - VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs(%1,%2)").arg(device).arg(cardtype)); + LOG(VB_GENERAL, LOG_DEBUG, QString("ProbeAudioInputs(%1,%2)") + .arg(device).arg(cardtype)); QStringList ret; if ("HDPVR" == cardtype) @@ -1769,16 +1769,16 @@ QStringList CardUtil::ProbeV4LVideoInputs(QString device) QStringList CardUtil::ProbeV4LAudioInputs(QString device) { - VERBOSE(VB_IMPORTANT, QString("ProbeV4LAudioInputs(%1)").arg(device)); + LOG(VB_GENERAL, LOG_DEBUG, QString("ProbeV4LAudioInputs(%1)").arg(device)); bool ok; QStringList ret; int videofd = open(device.toAscii().constData(), O_RDWR); if (videofd < 0) { - VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs() -> couldn't open device")); - ret += QObject::tr("Could not open '%1' " - "to probe its inputs.").arg(device); + LOG(VB_GENERAL, LOG_ERR, "ProbeAudioInputs() -> couldn't open device"); + ret += QObject::tr("Could not open '%1' to probe its inputs.") + .arg(device); return ret; } InputNames list = CardUtil::ProbeV4LAudioInputs(videofd, ok); @@ -2081,8 +2081,8 @@ QString CardUtil::GetHDHRdesc(const QString &device) } - VERBOSE(VB_GENERAL, "CardUtil::GetHDHRdescription(" - + device + ") - trying to locate device"); + LOG(VB_GENERAL, LOG_INFO, "CardUtil::GetHDHRdescription(" + device + + ") - trying to locate device"); hdhomerun_device_t *hdhr; hdhr = hdhomerun_device_create_from_str(device.toAscii(), NULL); diff --git a/mythtv/libs/libmythtv/cc608decoder.cpp b/mythtv/libs/libmythtv/cc608decoder.cpp index 78b944eb7fb..b7d2199c921 100644 --- a/mythtv/libs/libmythtv/cc608decoder.cpp +++ b/mythtv/libs/libmythtv/cc608decoder.cpp @@ -156,12 +156,12 @@ void CC608Decoder::FormatCCField(int tc, int field, int data) b1 = data & 0x7f; b2 = (data >> 8) & 0x7f; -/* - VERBOSE(VB_VBI, QString("Format CC @%1/%2 = %3 %4") +#if 0 + LOG(VB_VBI, LOG_DEBUG, QString("Format CC @%1/%2 = %3 %4") .arg(tc).arg(field) .arg((data&0xff), 2, 16) .arg((data&0xff00)>>8, 2, 16)); -*/ +#endif if (ccmode[field] >= 0) { mode = field << 2 | @@ -642,15 +642,15 @@ void CC608Decoder::BufferCC(int mode, int len, int clr) else len = sizeof(ccsubtitle); - VERBOSE(VB_VBI, QString("### %1 %2 %3 %4 %5 %6 %7 -") + LOG(VB_VBI, LOG_INFO, QString("### %1 %2 %3 %4 %5 %6 %7 -") .arg(timecode[mode], 10) .arg(row[mode], 2).arg(rowcount[mode]) .arg(style[mode]).arg(f, 2, 16) .arg(clr).arg(len, 3)); - if (len && VERBOSE_LEVEL_CHECK(VB_VBI)) + if (len && VERBOSE_LEVEL_CHECK(VB_VBI) && logLevel <= LOG_DEBUG) { QString dispbuf = QString::fromUtf8(tmpbuf.constData(), len); - VERBOSE(VB_VBI, QString("%1 '").arg(timecode[mode], 10)); + LOG(VB_VBI, LOG_DEBUG, QString("%1 '").arg(timecode[mode], 10)); QString vbuf = ""; int i = 0; while (i < dispbuf.length()) { @@ -673,7 +673,7 @@ void CC608Decoder::BufferCC(int mode, int len, int clr) } i++; } - VERBOSE(VB_VBI, vbuf); + LOG(VB_VBI, LOG_DEBUG, vbuf); } reader->AddTextData(rbuf, len, timecode[mode], 'C'); @@ -820,17 +820,17 @@ static void DumpPIL(int pil) (((day) << 15) + ((mon) << 11) + ((hour) << 6) + ((min) << 0)) if (pil == _PIL_(0, 15, 31, 63)) - VERBOSE(VB_VBI, " PDC: Timer-control (no PDC)"); + LOG(VB_VBI, LOG_INFO, " PDC: Timer-control (no PDC)"); else if (pil == _PIL_(0, 15, 30, 63)) - VERBOSE(VB_VBI, " PDC: Recording inhibit/terminate"); + LOG(VB_VBI, LOG_INFO, " PDC: Recording inhibit/terminate"); else if (pil == _PIL_(0, 15, 29, 63)) - VERBOSE(VB_VBI, " PDC: Interruption"); + LOG(VB_VBI, LOG_INFO, " PDC: Interruption"); else if (pil == _PIL_(0, 15, 28, 63)) - VERBOSE(VB_VBI, " PDC: Continue"); + LOG(VB_VBI, LOG_INFO, " PDC: Continue"); else if (pil == _PIL_(31, 15, 31, 63)) - VERBOSE(VB_VBI, " PDC: No time"); + LOG(VB_VBI, LOG_INFO, " PDC: No time"); else - VERBOSE(VB_VBI, QString(" PDC: %1, 200X-%2-%3 %4:%5") + LOG(VB_VBI, LOG_INFO, QString(" PDC: %1, 200X-%2-%3 %4:%5") .arg(pil).arg(mon).arg(day).arg(hour).arg(min)); #undef _PIL_ } @@ -851,7 +851,7 @@ void CC608Decoder::DecodeVPS(const unsigned char *buf) vps_label[vps_l] = Printable(c); vps_l = (vps_l + 1) % 16; - VERBOSE(VB_VBI, QString("VPS: 3-10: %1 %2 %3 %4 %5 %6 %7 %8 (\"%9\")") + LOG(VB_VBI, LOG_INFO, QString("VPS: 3-10: %1 %2 %3 %4 %5 %6 %7 %8 (\"%9\")") .arg(buf[0]).arg(buf[1]).arg(buf[2]).arg(buf[3]).arg(buf[4]) .arg(buf[5]).arg(buf[6]).arg(buf[7]).arg(vps_pr_label)); @@ -863,7 +863,7 @@ void CC608Decoder::DecodeVPS(const unsigned char *buf) pil = ((buf[8] & 0x3F) << 14) + (buf[9] << 6) + (buf[10] >> 2); pty = buf[12]; - VERBOSE(VB_VBI, QString("CNI: %1 PCS: %2 PTY: %3 ") + LOG(VB_VBI, LOG_INFO, QString("CNI: %1 PCS: %2 PTY: %3 ") .arg(cni).arg(pcs).arg(pty)); DumpPIL(pil); @@ -893,7 +893,7 @@ void CC608Decoder::DecodeWSS(const unsigned char *buf) parity ^= parity >> 2; parity ^= parity >> 1; - VERBOSE(VB_VBI, + LOG(VB_VBI, LOG_INFO, QString("WSS: %1; %2 mode; %3 color coding;\n\t\t\t" " %4 helper; reserved b7=%5; %6\n\t\t\t" " open subtitles: %7; %scopyright %8; copying %9") @@ -921,7 +921,7 @@ QString CC608Decoder::XDSDecodeString(const vector &buf, #if DEBUG_XDS for (uint i = start; (i < buf.size()) && (i < end); i++) { - VERBOSE(VB_VBI, QString("%1: 0x%2 -> 0x%3 %4") + LOG(VB_VBI, LOG_INFO, QString("%1: 0x%2 -> 0x%3 %4") .arg(i,2).arg(buf[i],2,16) .arg(CharCC(buf[i]),2,16) .arg(CharCC(buf[i]))); @@ -936,7 +936,7 @@ QString CC608Decoder::XDSDecodeString(const vector &buf, } #if DEBUG_XDS - VERBOSE(VB_VBI, QString("XDSDecodeString: '%1'").arg(tmp)); + LOG(VB_VBI, LOG_INFO, QString("XDSDecodeString: '%1'").arg(tmp)); #endif // DEBUG_XDS return tmp.trimmed(); @@ -1086,8 +1086,8 @@ QString CC608Decoder::GetXDS(const QString &key) const void CC608Decoder::XDSDecode(int /*field*/, int b1, int b2) { #if DEBUG_XDS - VERBOSE(VB_VBI, QString("XDSDecode: 0x%1 0x%2 (cp 0x%3) '%4%5' " - "xds[%6]=%7") + LOG(VB_VBI, LOG_INFO, + QString("XDSDecode: 0x%1 0x%2 (cp 0x%3) '%4%5' xds[%6]=%7") .arg(b1,2,16).arg(b2,2,16).arg(xds_current_packet,0,16) .arg(((int)CharCC(b1)>0x20) ? CharCC(b1) : QChar(' ')) .arg(((int)CharCC(b2)>0x20) ? CharCC(b2) : QChar(' ')) @@ -1137,7 +1137,7 @@ void CC608Decoder::XDSPacketParse(const vector &xds_buf) #if DEBUG_XDS if (!handled) { - VERBOSE(VB_VBI, QString("XDS: ") + + LOG(VB_VBI, LOG_INFO, QString("XDS: ") + QString("Unhandled packet (0x%1 0x%2) sz(%3) '%4'") .arg(xds_buf[0],0,16).arg(xds_buf[1],0,16) .arg(xds_buf.size()) @@ -1157,7 +1157,7 @@ bool CC608Decoder::XDSPacketCRC(const vector &xds_buf) { xds_crc_failed++; - VERBOSE(VB_VBI, QString("XDS: failed CRC %1/%2") + LOG(VB_VBI, LOG_ERR, QString("XDS: failed CRC %1/%2") .arg(xds_crc_failed).arg(xds_crc_failed + xds_crc_passed)); return false; @@ -1183,7 +1183,7 @@ bool CC608Decoder::XDSPacketParseProgram( uint month = xds_buf[5] & 0x0f; month = (month < 1 || month > 12) ? 0 : month; - VERBOSE(VB_VBI, loc + + LOG(VB_VBI, LOG_INFO, loc + QString("Start Time %1/%2 %3:%4%5") .arg(month).arg(day).arg(hour).arg(min / 10).arg(min % 10)); } @@ -1209,7 +1209,7 @@ bool CC608Decoder::XDSPacketParseProgram( .arg(length_elapsed_min / 10).arg(length_elapsed_min % 10) .arg(length_elapsed_secs / 10).arg(length_elapsed_secs % 10); - VERBOSE(VB_VBI, loc + msg); + LOG(VB_VBI, LOG_INFO, loc + msg); } else if ((b2 == 0x03) && (xds_buf.size() >= 6)) { @@ -1217,7 +1217,7 @@ bool CC608Decoder::XDSPacketParseProgram( if (is_better(tmp, xds_program_name[cf])) { xds_program_name[cf] = tmp; - VERBOSE(VB_VBI, loc + QString("Program Name: '%1'") + LOG(VB_VBI, LOG_INFO, loc + QString("Program Name: '%1'") .arg(GetProgramName(future))); } } @@ -1238,7 +1238,7 @@ bool CC608Decoder::XDSPacketParseProgram( if (!unchanged) { xds_program_type[cf] = program_type; - VERBOSE(VB_VBI, loc + QString("Program Type '%1'") + LOG(VB_VBI, LOG_INFO, loc + QString("Program Type '%1'") .arg(GetProgramType(future))); } } @@ -1256,7 +1256,7 @@ bool CC608Decoder::XDSPacketParseProgram( { xds_rating_systems[cf] |= kHasCanEnglish; xds_rating[cf][kRatingCanEnglish] = tv_rating; - VERBOSE(VB_VBI, loc + QString("VChip %1") + LOG(VB_VBI, LOG_INFO, loc + QString("VChip %1") .arg(GetRatingString(kRatingCanEnglish, future))); } } @@ -1267,7 +1267,7 @@ bool CC608Decoder::XDSPacketParseProgram( { xds_rating_systems[cf] |= kHasCanFrench; xds_rating[cf][kRatingCanFrench] = tv_rating; - VERBOSE(VB_VBI, loc + QString("VChip %1") + LOG(VB_VBI, LOG_INFO, loc + QString("VChip %1") .arg(GetRatingString(kRatingCanFrench, future))); } } @@ -1281,7 +1281,7 @@ bool CC608Decoder::XDSPacketParseProgram( uint f = ((xds_buf[0]<<3) & 0x80) | ((xds_buf[1]<<1) & 0x70); xds_rating_systems[cf] |= kHasTPG; xds_rating[cf][kRatingTPG] = tv_rating | f; - VERBOSE(VB_VBI, loc + QString("VChip %1") + LOG(VB_VBI, LOG_INFO, loc + QString("VChip %1") .arg(GetRatingString(kRatingTPG, future))); } } @@ -1292,13 +1292,13 @@ bool CC608Decoder::XDSPacketParseProgram( { xds_rating_systems[cf] |= kHasMPAA; xds_rating[cf][kRatingMPAA] = movie_rating; - VERBOSE(VB_VBI, loc + QString("VChip %1") + LOG(VB_VBI, LOG_INFO, loc + QString("VChip %1") .arg(GetRatingString(kRatingMPAA, future))); } } else { - VERBOSE(VB_VBI, loc + + LOG(VB_VBI, LOG_ERR, loc + QString("VChip Unhandled -- rs(%1) rating(%2:%3)") .arg(rating_system).arg(tv_rating).arg(movie_rating)); } @@ -1338,7 +1338,7 @@ bool CC608Decoder::XDSPacketParseChannel(const vector &xds_buf) QString tmp = XDSDecodeString(xds_buf, 2, xds_buf.size() - 2); if (is_better(tmp, xds_net_name)) { - VERBOSE(VB_VBI, QString("XDS: Network Name '%1'").arg(tmp)); + LOG(VB_VBI, LOG_INFO, QString("XDS: Network Name '%1'").arg(tmp)); xds_net_name = tmp; } } @@ -1347,7 +1347,7 @@ bool CC608Decoder::XDSPacketParseChannel(const vector &xds_buf) QString tmp = XDSDecodeString(xds_buf, 2, xds_buf.size() - 2); if (is_better(tmp, xds_net_call) && (tmp.indexOf(" ") < 0)) { - VERBOSE(VB_VBI, QString("XDS: Network Call '%1'").arg(tmp)); + LOG(VB_VBI, LOG_INFO, QString("XDS: Network Call '%1'").arg(tmp)); xds_net_call = tmp; } } @@ -1357,7 +1357,7 @@ bool CC608Decoder::XDSPacketParseChannel(const vector &xds_buf) xds_buf[4] << 8 | xds_buf[5]); if (tsid != xds_tsid) { - VERBOSE(VB_VBI, QString("XDS: TSID 0x%1").arg(tsid,0,16)); + LOG(VB_VBI, LOG_INFO, QString("XDS: TSID 0x%1").arg(tsid,0,16)); xds_tsid = tsid; } } diff --git a/mythtv/libs/libmythtv/cc608reader.cpp b/mythtv/libs/libmythtv/cc608reader.cpp index 10d00f25df2..48247f14a28 100644 --- a/mythtv/libs/libmythtv/cc608reader.cpp +++ b/mythtv/libs/libmythtv/cc608reader.cpp @@ -434,7 +434,7 @@ void CC608Reader::AddTextData(unsigned char *buffer, int len, if (!(MAXTBUFFER - NumInputBuffers() - 1)) { - VERBOSE(VB_IMPORTANT, "NVP::AddTextData(): Text buffer overflow"); + LOG(VB_GENERAL, LOG_ERR, "AddTextData(): Text buffer overflow"); return; } @@ -460,8 +460,8 @@ void CC608Reader::AddTextData(unsigned char *buffer, int len, to appear rapidly, but at least the captions won't appear to be stuck. */ - VERBOSE(VB_VBI, - QString("Writing caption timecode %1 but waiting on %2") + LOG(VB_VBI, LOG_INFO, + QString("Writing caption timecode %1 but waiting on %2") .arg(timecode).arg(m_inputBuffers[m_readPosition].timecode)); m_inputBuffers[m_readPosition].timecode = m_inputBuffers[prev_readpos].timecode + 500; diff --git a/mythtv/libs/libmythtv/cc708decoder.cpp b/mythtv/libs/libmythtv/cc708decoder.cpp index 5b7d2b13df4..d87730b961c 100644 --- a/mythtv/libs/libmythtv/cc708decoder.cpp +++ b/mythtv/libs/libmythtv/cc708decoder.cpp @@ -42,8 +42,10 @@ void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2) { if (DTVCC_PACKET_START == cc_type) { - //VERBOSE(VB_IMPORTANT, LOC + QString("CC ST data(0x%1 0x%2)") - // .arg(data1,0,16).arg(data2,0,16)); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, QString("CC ST data(0x%1 0x%2)") + .arg(data1,0,16).arg(data2,0,16)); +#endif if (partialPacket.size && reader) parse_cc_packet(reader, &partialPacket, last_seen); @@ -54,8 +56,10 @@ void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2) } else if (DTVCC_PACKET_DATA == cc_type) { - //VERBOSE(VB_IMPORTANT, LOC + QString("CC Ex data(0x%1 0x%2)") - // .arg(data1,0,16).arg(data2,0,16)); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, QString("CC Ex data(0x%1 0x%2)") + .arg(data1,0,16).arg(data2,0,16)); +#endif partialPacket.data[partialPacket.size + 0] = data1; partialPacket.data[partialPacket.size + 1] = data2; diff --git a/mythtv/libs/libmythtv/cc708reader.cpp b/mythtv/libs/libmythtv/cc708reader.cpp index b4686fc56e5..9aed3ca53cc 100644 --- a/mythtv/libs/libmythtv/cc708reader.cpp +++ b/mythtv/libs/libmythtv/cc708reader.cpp @@ -9,7 +9,7 @@ #include "cc708reader.h" #define LOC QString("CC708Reader: ") -#define CHECKENABLED if (!enabled) return; +#define CHECKENABLED if (!enabled) return CC708Reader::CC708Reader(MythPlayer *owner) : currentservice(1), parent(owner), enabled(false) @@ -45,8 +45,8 @@ void CC708Reader::ClearBuffers(void) void CC708Reader::SetCurrentWindow(uint service_num, int window_id) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("SetCurrentWindow(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("SetCurrentWindow(%1, %2)") .arg(service_num).arg(window_id)); CC708services[service_num].current_window = window_id; } @@ -66,20 +66,21 @@ void CC708Reader::DefineWindow( parent->GetDecoder()->InsertTrack(kTrackTypeCC708, si); } - CHECKENABLED + CHECKENABLED; CC708DelayedDeletes[service_num & 63] &= ~(1 << window_id); - VERBOSE(VB_VBI, LOC + QString("DefineWindow(%1, %2,\n\t\t\t\t\t") + LOG(VB_VBI, LOG_INFO, + QString("DefineWindow(%1, %2,\n\t\t\t\t\t") .arg(service_num).arg(window_id) + - QString(" prio %1, vis %2, ap %3, rp %4, av %5, ah %6") + QString(" prio %1, vis %2, ap %3, rp %4, av %5, ah %6") .arg(priority).arg(visible).arg(anchor_point).arg(relative_pos) .arg(anchor_vertical).arg(anchor_horizontal) + - QString("\n\t\t\t\t\t row_cnt %1, row_lck %2, " + QString("\n\t\t\t\t\t row_cnt %1, row_lck %2, " "col_cnt %3, col_lck %4 ") .arg(row_count).arg(row_lock) .arg(column_count).arg(column_lock) + - QString("\n\t\t\t\t\t pen style %1, win style %2)") + QString("\n\t\t\t\t\t pen style %1, win style %2)") .arg(pen_style).arg(window_style)); GetCCWin(service_num, window_id) @@ -95,8 +96,8 @@ void CC708Reader::DefineWindow( void CC708Reader::DeleteWindows(uint service_num, int window_map) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("DeleteWindows(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("DeleteWindows(%1, %2)") .arg(service_num).arg(window_map, 8, 2, QChar(48))); for (uint i = 0; i < 8; i++) @@ -107,8 +108,8 @@ void CC708Reader::DeleteWindows(uint service_num, int window_map) void CC708Reader::DisplayWindows(uint service_num, int window_map) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("DisplayWindows(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("DisplayWindows(%1, %2)") .arg(service_num).arg(window_map, 8, 2, QChar(48))); for (uint i = 0; i < 8; i++) @@ -135,16 +136,16 @@ void CC708Reader::DisplayWindows(uint service_num, int window_map) CC708Window &win = GetCCWin(service_num, i); win.visible = true; win.changed = true; - VERBOSE(VB_VBI, LOC + - QString("DisplayedWindow(%1, %2)").arg(service_num).arg(i)); + LOG(VB_VBI, LOG_INFO, + QString("DisplayedWindow(%1, %2)").arg(service_num).arg(i)); } } } void CC708Reader::HideWindows(uint service_num, int window_map) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("HideWindows(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("HideWindows(%1, %2)") .arg(service_num).arg(window_map, 8, 2, QChar(48))); for (uint i = 0; i < 8; i++) @@ -160,8 +161,8 @@ void CC708Reader::HideWindows(uint service_num, int window_map) void CC708Reader::ClearWindows(uint service_num, int window_map) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("ClearWindows(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("ClearWindows(%1, %2)") .arg(service_num).arg(window_map, 8, 2, QChar(48))); for (uint i = 0; i < 8; i++) @@ -171,8 +172,8 @@ void CC708Reader::ClearWindows(uint service_num, int window_map) void CC708Reader::ToggleWindows(uint service_num, int window_map) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("ToggleWindows(%1, %2)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("ToggleWindows(%1, %2)") .arg(service_num).arg(window_map, 8, 2, QChar(48))); for (uint i = 0; i < 8; i++) @@ -195,8 +196,8 @@ void CC708Reader::SetWindowAttributes( int display_effect, int effect_speed, int justify, int word_wrap) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("SetWindowAttributes(%1...)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("SetWindowAttributes(%1...)") .arg(service_num)); CC708Window &win = GetCCWin(service_num); @@ -219,8 +220,8 @@ void CC708Reader::SetPenAttributes( int offset, int text_tag, int font_tag, int edge_type, int underline, int italics) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("SetPenAttributes(%1, %2,") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("SetPenAttributes(%1, %2,") .arg(service_num).arg(CC708services[service_num].current_window) + QString("\n\t\t\t\t\t pen_size %1, offset %2, text_tag %3, " "font_tag %4," @@ -238,8 +239,8 @@ void CC708Reader::SetPenColor( int bg_color, int bg_opacity, int edge_color) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("SetPenColor(%1...)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("SetPenColor(%1...)") .arg(service_num)); CC708CharacterAttribute &attr = GetCCWin(service_num).pen.attr; @@ -253,29 +254,29 @@ void CC708Reader::SetPenColor( void CC708Reader::SetPenLocation(uint service_num, int row, int column) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("SetPenLocation(%1, (c %2, r %3))") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("SetPenLocation(%1, (c %2, r %3))") .arg(service_num).arg(column).arg(row)); GetCCWin(service_num).SetPenLocation(row, column); } void CC708Reader::Delay(uint service_num, int tenths_of_seconds) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("Delay(%1, %2 seconds)") + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("Delay(%1, %2 seconds)") .arg(service_num).arg(tenths_of_seconds * 0.1f)); } void CC708Reader::DelayCancel(uint service_num) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("DelayCancel(%1)").arg(service_num)); + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("DelayCancel(%1)").arg(service_num)); } void CC708Reader::Reset(uint service_num) { - CHECKENABLED - VERBOSE(VB_VBI, LOC + QString("Reset(%1)").arg(service_num)); + CHECKENABLED; + LOG(VB_VBI, LOG_INFO, QString("Reset(%1)").arg(service_num)); DeleteWindows(service_num, 0x7); DelayCancel(service_num); } @@ -283,14 +284,14 @@ void CC708Reader::Reset(uint service_num) void CC708Reader::TextWrite(uint service_num, short* unicode_string, short len) { - CHECKENABLED + CHECKENABLED; QString debug = QString(); for (uint i = 0; i < (uint)len; i++) { GetCCWin(service_num).AddChar(QChar(unicode_string[i])); debug += QChar(unicode_string[i]); } - VERBOSE(VB_VBI, LOC + QString("AddText to %1->%2 |%3|") + LOG(VB_VBI, LOG_INFO, QString("AddText to %1->%2 |%3|") .arg(service_num).arg(CC708services[service_num].current_window).arg(debug)); } diff --git a/mythtv/libs/libmythtv/cc708window.cpp b/mythtv/libs/libmythtv/cc708window.cpp index 982eb84b8e7..e133eae80f1 100644 --- a/mythtv/libs/libmythtv/cc708window.cpp +++ b/mythtv/libs/libmythtv/cc708window.cpp @@ -346,8 +346,8 @@ void CC708Window::AddChar(QChar ch) if (!IsPenValid()) { - VERBOSE(VB_VBI, - QString("AddChar(%1) at (c %2, r %3) INVALID win(%4,%5)") + LOG(VB_VBI, LOG_INFO, + QString("AddChar(%1) at (c %2, r %3) INVALID win(%4,%5)") .arg(dbg_char).arg(pen.column).arg(pen.row) .arg(true_column_count).arg(true_row_count)); return; @@ -384,7 +384,7 @@ void CC708Window::AddChar(QChar ch) IncrPenLocation(); changed = true; - VERBOSE(VB_VBI, QString("AddChar(%1) at (c %2, r %3) -> (%4,%5)") + LOG(VB_VBI, LOG_INFO, QString("AddChar(%1) at (c %2, r %3) -> (%4,%5)") .arg(dbg_char).arg(c).arg(r).arg(pen.column).arg(pen.row)); } @@ -433,7 +433,7 @@ void CC708Window::IncrPenLocation(void) new_row += (print_dir == k708DirBottomToTop) ? -1 : 0; #if 0 - VERBOSE(VB_VBI, QString("IncrPen dir%1: (c %2, r %3) -> (%4,%5)") + LOG(VB_VBI, LOG_INFO, QString("IncrPen dir%1: (c %2, r %3) -> (%4,%5)") .arg(print_dir).arg(pen.column).arg(pen.row) .arg(new_column).arg(new_row)); #endif @@ -475,7 +475,7 @@ void CC708Window::DecrPenLocation(void) new_row -= (print_dir == k708DirBottomToTop) ? -1 : 0; #if 0 - VERBOSE(VB_VBI, QString("DecrPen dir%1: (c %2, r %3) -> (%4,%5)") + LOG(VB_VBI, LOG_INFO, QString("DecrPen dir%1: (c %2, r %3) -> (%4,%5)") .arg(print_dir).arg(pen.column).arg(pen.row) .arg(new_column).arg(new_row)); #endif diff --git a/mythtv/libs/libmythtv/channelbase.cpp b/mythtv/libs/libmythtv/channelbase.cpp index 78c2a6f5bef..9fa7d3e846e 100644 --- a/mythtv/libs/libmythtv/channelbase.cpp +++ b/mythtv/libs/libmythtv/channelbase.cpp @@ -93,7 +93,7 @@ bool ChannelBase::Init(QString &inputname, QString &startchannel, bool setchan) if (start != inputs.end()) { - VERBOSE(VB_CHANNEL, LOC + + LOG(VB_CHANNEL, LOG_INFO, QString("Looking for startchannel '%1' on input '%2'") .arg(startchannel).arg(*start)); } @@ -111,7 +111,7 @@ bool ChannelBase::Init(QString &inputname, QString &startchannel, bool setchan) IsTunable(*it, startchannel)) { inputname = *it; - VERBOSE(VB_CHANNEL, LOC + + LOG(VB_CHANNEL, LOG_INFO, QString("Found startchannel '%1' on input '%2'") .arg(startchannel).arg(inputname)); return true; @@ -171,9 +171,8 @@ bool ChannelBase::Init(QString &inputname, QString &startchannel, bool setchan) break; } - VERBOSE(((msg_error) ? VB_IMPORTANT : VB_GENERAL), - ((msg_error) ? LOC_ERR : LOC_WARN) + - msg1 + "\n\t\t\t" + msg2); + LOG(VB_GENERAL, ((msg_error) ? LOG_ERR : LOG_WARNING), + msg1 + "\n\t\t\t" + msg2); return ok; } @@ -189,8 +188,8 @@ bool ChannelBase::IsTunable(const QString &input, const QString &channum) const InputMap::const_iterator it = m_inputs.find(inputid); if (it == m_inputs.end()) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Requested non-existant input '%1':'%2' ") + LOG(VB_GENERAL, LOG_ERR, loc + " " + + QString("Requested non-existant input '%1':'%2' ") .arg(input).arg(inputid)); return false; @@ -199,8 +198,8 @@ bool ChannelBase::IsTunable(const QString &input, const QString &channum) const uint mplexid_restriction; if (!IsInputAvailable(inputid, mplexid_restriction)) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Requested channel is on input '%1' " + LOG(VB_GENERAL, LOG_ERR, loc + " " + + QString("Requested channel is on input '%1' " "which is in a busy input group") .arg(inputid)); @@ -215,15 +214,14 @@ bool ChannelBase::IsTunable(const QString &input, const QString &channum) const uint atsc_major, atsc_minor, mplexid, tsid, netid; bool commfree; - if (!ChannelUtil::GetChannelData( - (*it)->sourceid, channum, - tvformat, modulation, freqtable, freqid, - finetune, frequency, - dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, - mplexid, commfree)) + if (!ChannelUtil::GetChannelData((*it)->sourceid, channum, + tvformat, modulation, freqtable, freqid, + finetune, frequency, dtv_si_std, + mpeg_prog_num, atsc_major, atsc_minor, + tsid, netid, mplexid, commfree)) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Failed to find channel in DB on input '%1' ") + LOG(VB_GENERAL, LOG_ERR, loc + " " + + QString("Failed to find channel in DB on input '%1' ") .arg(inputid)); return false; @@ -231,8 +229,8 @@ bool ChannelBase::IsTunable(const QString &input, const QString &channum) const if (mplexid_restriction && (mplexid != mplexid_restriction)) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Channel is valid, but tuner is busy " + LOG(VB_GENERAL, LOG_ERR, loc + " " + + QString("Channel is valid, but tuner is busy " "on different multiplex (%1 != %2)") .arg(mplexid).arg(mplexid_restriction)); @@ -355,14 +353,14 @@ bool ChannelBase::SwitchToInput(const QString &inputname) if (input >= 0) return SwitchToInput(input, true); else - VERBOSE(VB_IMPORTANT, QString("ChannelBase: Could not find input: " - "%1 on card\n").arg(inputname)); + LOG(VB_GENERAL, LOG_ERR, QString("ChannelBase: Could not find input: " + "%1 on card\n").arg(inputname)); return false; } bool ChannelBase::SwitchToInput(const QString &inputname, const QString &chan) { - VERBOSE(VB_CHANNEL, LOC + QString("SwitchToInput(%1,%2)") + LOG(VB_CHANNEL, LOG_DEBUG, QString("SwitchToInput(%1,%2)") .arg(inputname).arg(chan)); int input = GetInputByName(inputname); @@ -376,7 +374,7 @@ bool ChannelBase::SwitchToInput(const QString &inputname, const QString &chan) } else { - VERBOSE(VB_IMPORTANT, + LOG(VB_GENERAL, LOG_ERR, QString("ChannelBase: Could not find input: %1 on card when " "setting channel %2\n").arg(inputname).arg(chan)); } @@ -681,7 +679,7 @@ void ChannelBase::HandleScript(const QString &freqid) if (freqid.isEmpty()) { - VERBOSE(VB_IMPORTANT, LOC_WARN + + LOG(VB_GENERAL, LOG_WARNING, "A channel changer is set, but the freqid field is empty." "\n\t\t\tWe will return success to ease setup pains, " "but no script is will actually run."); @@ -705,9 +703,9 @@ void ChannelBase::HandleScript(const QString &freqid) if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "Can not execute channel changer, previous call to script " - "is still running."); + LOG(VB_GENERAL, LOG_ERR, + "Can not execute channel changer, previous call to script " + "is still running."); m_process_status = 2; // failed HandleScriptEnd(ok); } @@ -716,8 +714,7 @@ void ChannelBase::HandleScript(const QString &freqid) ok = ChangeExternalChannel((*it)->externalChanger, freqid); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "Can not execute channel changer."); + LOG(VB_GENERAL, LOG_ERR, "Can not execute channel changer."); m_process_status = 2; // failed HandleScriptEnd(ok); } @@ -734,7 +731,7 @@ bool ChannelBase::ChangeExternalChannel( return false; QString command = QString("/bin/sh -c \"%1 %2\"").arg(changer).arg(freqid); - VERBOSE(VB_CHANNEL, LOC + QString("Running command: %1").arg(command)); + LOG(VB_CHANNEL, LOG_INFO, QString("Running command: %1").arg(command)); if (!m_process_thread) { @@ -767,7 +764,7 @@ uint ChannelBase::GetScriptStatus(bool holding_lock) delete m_process; m_process = NULL; - VERBOSE(VB_CHANNEL, LOC + QString("GetScriptStatus() %1") + LOG(VB_CHANNEL, LOG_INFO, QString("GetScriptStatus() %1") .arg(m_process_status)); HandleScriptEnd(3 == m_process_status); @@ -786,7 +783,7 @@ uint ChannelBase::GetScriptStatus(bool holding_lock) case QProcess::Starting: ps = "starting"; break; } } - VERBOSE(VB_CHANNEL, LOC + QString("GetScriptStatus() %1 (ps %2)") + LOG(VB_CHANNEL, LOG_INFO, QString("GetScriptStatus() %1 (ps %2)") .arg(m_process_status).arg(ps)); } @@ -801,8 +798,8 @@ uint ChannelBase::GetScriptStatus(bool holding_lock) /// \note m_process_lock must be held when this is called void ChannelBase::HandleScriptEnd(bool ok) { - VERBOSE(VB_CHANNEL, LOC + "Channel change script " + - ((ok) ? "succeeded" : "failed")); + LOG(VB_CHANNEL, LOG_INFO, QString("Channel change script %1") + .arg((ok) ? "succeeded" : "failed")); if (ok) { @@ -870,8 +867,8 @@ bool ChannelBase::InitializeInputs(void) uint cardid = max(GetCardID(), 0); if (!cardid) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "InitializeInputs(): " - "Programmer error, cardid invalid."); + LOG(VB_GENERAL, LOG_ERR, + "InitializeInputs(): Programmer error, cardid invalid."); return false; } @@ -892,7 +889,7 @@ bool ChannelBase::InitializeInputs(void) } else if (!query.size()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "InitializeInputs(): " + LOG(VB_GENERAL, LOG_ERR, "InitializeInputs(): " "\n\t\t\tCould not get inputs for the capturecard." "\n\t\t\tPerhaps you have forgotten to bind video" "\n\t\t\tsources to your card's inputs?"); @@ -918,7 +915,7 @@ bool ChannelBase::InitializeInputs(void) if (!IsExternalChannelChangeSupported() && !m_inputs[query.value(0).toUInt()]->externalChanger.isEmpty()) { - VERBOSE(VB_IMPORTANT, LOC_WARN + "External Channel changer is " + LOG(VB_GENERAL, LOG_WARNING, "External Channel changer is " "set, but this device does not support it."); m_inputs[query.value(0).toUInt()]->externalChanger.clear(); } @@ -938,12 +935,12 @@ bool ChannelBase::InitializeInputs(void) InputMap::const_iterator it; for (it = m_inputs.begin(); it != m_inputs.end(); ++it) { - VERBOSE(VB_CHANNEL, LOC + QString("Input #%1: '%2' schan(%3) " + LOG(VB_CHANNEL, LOG_INFO, QString("Input #%1: '%2' schan(%3) " "sourceid(%4) ccid(%5)") .arg(it.key()).arg((*it)->name).arg((*it)->startChanNum) .arg((*it)->sourceid).arg((*it)->cardid)); } - VERBOSE(VB_CHANNEL, LOC + QString("Current Input #%1: '%2'") + LOG(VB_CHANNEL, LOG_INFO, QString("Current Input #%1: '%2'") .arg(GetCurrentInputNum()).arg(GetCurrentInput())); return m_inputs.size(); @@ -1066,7 +1063,7 @@ bool ChannelBase::CheckChannel(const QString &channum, QString msg = QString( "Failed to find channel(%1) on current input (%2) of card (%3).") .arg(channum).arg(channelinput).arg(GetCardID()); - VERBOSE(VB_CHANNEL, LOC + msg); + LOG(VB_CHANNEL, LOG_ERR, msg); // We didn't find it on the current input let's widen the search query.prepare( @@ -1094,14 +1091,14 @@ bool ChannelBase::CheckChannel(const QString &channum, msg = QString("Found channel(%1) on another input (%2) of card (%3).") .arg(channum).arg(inputName).arg(GetCardID()); - VERBOSE(VB_CHANNEL, LOC + msg); + LOG(VB_CHANNEL, LOG_INFO, msg); return true; } msg = QString("Failed to find channel(%1) on any input of card (%2).") .arg(channum).arg(GetCardID()); - VERBOSE(VB_CHANNEL, LOC + msg); + LOG(VB_CHANNEL, LOG_ERR, msg); query.prepare("SELECT NULL FROM channel"); @@ -1189,14 +1186,14 @@ ChannelBase *ChannelBase::CreateChannel( "from the configuration and restart MythTV.") .arg(genOpt.cardtype).arg(genOpt.videodev) .arg(genOpt.cardtype).arg(genOpt.cardtype); - VERBOSE(VB_IMPORTANT, "ChannelBase::CreateChannel() Error: \n" + + LOG(VB_GENERAL, LOG_ERR, "ChannelBase::CreateChannel() Error: \n" + msg + "\n"); return NULL; } if (!channel->Open()) { - VERBOSE(VB_IMPORTANT, "ChannelBase::CreateChannel() Error: " + + LOG(VB_GENERAL, LOG_ERR, "ChannelBase::CreateChannel() Error: " + QString("Failed to open device %1").arg(genOpt.videodev)); delete channel; return NULL; diff --git a/mythtv/libs/libmythtv/channelgroup.cpp b/mythtv/libs/libmythtv/channelgroup.cpp index 0618ae3946d..6eaf5eafa54 100644 --- a/mythtv/libs/libmythtv/channelgroup.cpp +++ b/mythtv/libs/libmythtv/channelgroup.cpp @@ -53,7 +53,8 @@ bool ChannelGroup::ToggleChannel(uint chanid, int changrpid, int delete_chan) query.bindValue(":CHANID", id); if (!query.exec()) MythDB::DBError("ChannelGroup::ToggleChannel -- delete", query); - VERBOSE(VB_IMPORTANT, LOC + QString("Removing channel with id=%1.").arg(id)); + LOG(VB_GENERAL, LOG_INFO, + QString("Removing channel with id=%1.").arg(id)); } else if (query.size() == 0) { @@ -64,7 +65,8 @@ bool ChannelGroup::ToggleChannel(uint chanid, int changrpid, int delete_chan) query.bindValue(":GRPID", changrpid); if (!query.exec()) MythDB::DBError("ChannelGroup::ToggleChannel -- insert", query); - VERBOSE(VB_IMPORTANT, LOC + QString("Adding channel %1 to group %2.").arg(chanid).arg(changrpid)); + LOG(VB_GENERAL, LOG_INFO, QString("Adding channel %1 to group %2.") + .arg(chanid).arg(changrpid)); } return true; @@ -97,7 +99,8 @@ bool ChannelGroup::AddChannel(uint chanid, int changrpid) query.bindValue(":GRPID", changrpid); if (!query.exec()) MythDB::DBError("ChannelGroup::AddChannel -- insert", query); - VERBOSE(VB_IMPORTANT, LOC + QString("Adding channel %1 to group %2.").arg(chanid).arg(changrpid)); + LOG(VB_GENERAL, LOG_INFO, QString("Adding channel %1 to group %2.") + .arg(chanid).arg(changrpid)); } return true; @@ -129,7 +132,8 @@ bool ChannelGroup::DeleteChannel(uint chanid, int changrpid) query.bindValue(":CHANID", id); if (!query.exec()) MythDB::DBError("ChannelGroup::DeleteChannel -- delete", query); - VERBOSE(VB_IMPORTANT, LOC + QString("Removing channel with id=%1.").arg(id)); + LOG(VB_GENERAL, LOG_INFO, + QString("Removing channel with id=%1.").arg(id)); } return true; diff --git a/mythtv/libs/libmythtv/channelscan/channelimporter.cpp b/mythtv/libs/libmythtv/channelscan/channelimporter.cpp index 05be3800836..553b55599f5 100644 --- a/mythtv/libs/libmythtv/channelscan/channelimporter.cpp +++ b/mythtv/libs/libmythtv/channelscan/channelimporter.cpp @@ -36,7 +36,7 @@ void ChannelImporter::Process(const ScanDTVTransportList &_transports) { if (use_gui) { - VERBOSE(VB_IMPORTANT, LOC + (ChannelUtil::GetChannelCount() + LOG(VB_GENERAL, LOG_INFO, (ChannelUtil::GetChannelCount() ? "No new channels to process" : "No channels to process..")); MythPopupBox::showOkPopup( @@ -244,7 +244,7 @@ uint ChannelImporter::DeleteUnusedTransports(uint sourceid) QString msg = QObject::tr("Found %n unused transport(s).", "", query.size()); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_INFO, msg); if (query.size() == 0) return 0; diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp index adb35b4d8ef..2fca7acb2f6 100644 --- a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp +++ b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp @@ -186,7 +186,7 @@ ChannelScanSM::ChannelScanSM( DTVSignalMonitor* dtvSigMon = GetDTVSignalMonitor(); if (dtvSigMon) { - VERBOSE(VB_CHANSCAN, LOC + "Connecting up DTVSignalMonitor"); + LOG(VB_CHANSCAN, LOG_INFO, "Connecting up DTVSignalMonitor"); ScanStreamData *data = new ScanStreamData(); dtvSigMon->SetStreamData(data); @@ -211,7 +211,7 @@ ChannelScanSM::ChannelScanSM( ChannelScanSM::~ChannelScanSM(void) { StopScanner(); - VERBOSE(VB_CHANSCAN, LOC + "ChannelScanSMner Stopped"); + LOG(VB_CHANSCAN, LOG_INFO, "ChannelScanSM Stopped"); ScanStreamData *sd = NULL; if (GetDTVSignalMonitor()) @@ -320,7 +320,7 @@ bool ChannelScanSM::ScanExistingTransports(uint sourceid, bool follow_nit) if (!multiplexes.size()) { - VERBOSE(VB_CHANSCAN, LOC + "Unable to find any transports for " + + LOG(VB_CHANSCAN, LOG_ERR, "Unable to find any transports for " + QString("sourceid %1").arg(sourceid)); return false; @@ -339,7 +339,7 @@ bool ChannelScanSM::ScanExistingTransports(uint sourceid, bool follow_nit) } else { - VERBOSE(VB_CHANSCAN, LOC + "Unable to find add any transports for " + + LOG(VB_CHANSCAN, LOG_ERR, "Unable to find add any transports for " + QString("sourceid %1").arg(sourceid)); return false; @@ -351,8 +351,8 @@ bool ChannelScanSM::ScanExistingTransports(uint sourceid, bool follow_nit) void ChannelScanSM::HandlePAT(const ProgramAssociationTable *pat) { - VERBOSE(VB_CHANSCAN, LOC + - QString("Got a Program Association Table for %1") + LOG(VB_CHANSCAN, LOG_INFO, + QString("Got a Program Association Table for %1") .arg((*current).FriendlyName) + "\n" + pat->toString()); // Add pmts to list, so we can do MPEG scan properly. @@ -366,8 +366,7 @@ void ChannelScanSM::HandlePAT(const ProgramAssociationTable *pat) void ChannelScanSM::HandlePMT(uint, const ProgramMapTable *pmt) { - VERBOSE(VB_CHANSCAN, LOC + - QString("Got a Program Map Table for %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("Got a Program Map Table for %1") .arg((*current).FriendlyName) + "\n" + pmt->toString()); if (!currentTestingDecryption && pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) @@ -376,7 +375,7 @@ void ChannelScanSM::HandlePMT(uint, const ProgramMapTable *pmt) void ChannelScanSM::HandleVCT(uint, const VirtualChannelTable *vct) { - VERBOSE(VB_CHANSCAN, LOC + QString("Got a Virtual Channel Table for %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("Got a Virtual Channel Table for %1") .arg((*current).FriendlyName) + "\n" + vct->toString()); for (uint i = 0; !currentTestingDecryption && i < vct->ChannelCount(); i++) @@ -392,7 +391,7 @@ void ChannelScanSM::HandleVCT(uint, const VirtualChannelTable *vct) void ChannelScanSM::HandleMGT(const MasterGuideTable *mgt) { - VERBOSE(VB_CHANSCAN, LOC + QString("Got the Master Guide for %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("Got the Master Guide for %1") .arg((*current).FriendlyName) + "\n" + mgt->toString()); UpdateChannelInfo(true); @@ -400,21 +399,24 @@ void ChannelScanSM::HandleMGT(const MasterGuideTable *mgt) void ChannelScanSM::HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) { - VERBOSE(VB_CHANSCAN, LOC + - QString("Got a Service Description Table for %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("Got a Service Description Table for %1") .arg((*current).FriendlyName) + "\n" + sdt->toString()); // If this is Astra 28.2 add start listening for Freesat BAT and SDTo - if (!setOtherTables && (sdt->OriginalNetworkID() == 2 || sdt->OriginalNetworkID() == 59)) + if (!setOtherTables && (sdt->OriginalNetworkID() == 2 || + sdt->OriginalNetworkID() == 59)) { - GetDTVSignalMonitor()->GetScanStreamData()->SetFreesatAdditionalSI(true); + GetDTVSignalMonitor()->GetScanStreamData()-> + SetFreesatAdditionalSI(true); setOtherTables = true; - otherTableTimeout = 10000; // The whole BAT & SDTo group comes round in 10s + // The whole BAT & SDTo group comes round in 10s + otherTableTimeout = 10000; // Delay processing the SDT until we've seen BATs and SDTos otherTableTime = timer.elapsed() + otherTableTimeout; - VERBOSE(VB_CHANSCAN, LOC + QString("SDT has OriginalNetworkID %1, look for " - "additional Freesat SI").arg(sdt->OriginalNetworkID())); + LOG(VB_CHANSCAN, LOG_INFO, + QString("SDT has OriginalNetworkID %1, look for " + "additional Freesat SI").arg(sdt->OriginalNetworkID())); } if ((uint)timer.elapsed() < otherTableTime) @@ -439,8 +441,7 @@ void ChannelScanSM::HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) void ChannelScanSM::HandleNIT(const NetworkInformationTable *nit) { - VERBOSE(VB_CHANSCAN, LOC + - QString("Got a Network Information Table for %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("Got a Network Information Table for %1") .arg((*current).FriendlyName) + "\n" + nit->toString()); UpdateChannelInfo(true); @@ -448,7 +449,7 @@ void ChannelScanSM::HandleNIT(const NetworkInformationTable *nit) void ChannelScanSM::HandleBAT(const BouquetAssociationTable *bat) { - VERBOSE(VB_CHANSCAN, LOC + "Got a Bouquet Association Table\n" + + LOG(VB_CHANSCAN, LOG_INFO, "Got a Bouquet Association Table\n" + bat->toString()); otherTableTime = timer.elapsed() + otherTableTimeout; @@ -473,13 +474,13 @@ void ChannelScanSM::HandleBAT(const BouquetAssociationTable *bat) for (uint j = 0; j < services.ServiceCount(); j++) { - // If the default authority is given in the SDT this - // overrides any definition in the BAT (or in the NIT) - VERBOSE(VB_CHANSCAN, LOC + QString("found default authority(BAT) " - "for service %1 %2 %3") + // If the default authority is given in the SDT this + // overrides any definition in the BAT (or in the NIT) + LOG(VB_CHANSCAN, LOG_INFO, + QString("found default authority(BAT) for service %1 %2 %3") .arg(netid).arg(tsid).arg(services.ServiceID(j))); - uint64_t index = - ((uint64_t)netid << 32) | (tsid << 16) | services.ServiceID(j); + uint64_t index = ((uint64_t)netid << 32) | (tsid << 16) | + services.ServiceID(j); if (! defAuthorities.contains(index)) defAuthorities[index] = authority.DefaultAuthority(); } @@ -489,7 +490,7 @@ void ChannelScanSM::HandleBAT(const BouquetAssociationTable *bat) void ChannelScanSM::HandleSDTo(uint tsid, const ServiceDescriptionTable *sdt) { - VERBOSE(VB_CHANSCAN, LOC + "Got a Service Description Table (other)\n" + + LOG(VB_CHANSCAN, LOG_INFO, "Got a Service Description Table (other)\n" + sdt->toString()); otherTableTime = timer.elapsed() + otherTableTimeout; @@ -508,8 +509,8 @@ void ChannelScanSM::HandleSDTo(uint tsid, const ServiceDescriptionTable *sdt) if (def_auth) { DefaultAuthorityDescriptor authority(def_auth); - VERBOSE(VB_CHANSCAN, LOC + QString("found default authority(SDTo) " - "for service %1 %2 %3") + LOG(VB_CHANSCAN, LOG_INFO, + QString("found default authority(SDTo) for service %1 %2 %3") .arg(netid).arg(tsid).arg(serviceId)); defAuthorities[((uint64_t)netid << 32) | (tsid << 16) | serviceId] = authority.DefaultAuthority(); @@ -531,7 +532,7 @@ bool ChannelScanSM::TestNextProgramEncryption(void) { if (!currentInfo || currentInfo->pmts.empty()) { - VERBOSE(VB_IMPORTANT, LOC + "Can't monitor decryption -- no pmts"); + LOG(VB_GENERAL, LOG_ERR, "Can't monitor decryption -- no pmts"); currentTestingDecryption = false; return false; } @@ -541,7 +542,7 @@ bool ChannelScanSM::TestNextProgramEncryption(void) uint pnum = 0; QMap::const_iterator it = currentEncryptionStatus.begin(); #if 0 - VERBOSE(VB_GENERAL, QString("%1/%2 checked") + LOG(VB_GENERAL, LOG_DEBUG, QString("%1/%2 checked") .arg(currentEncryptionStatusChecked.size()) .arg(currentEncryptionStatus.size())); #endif @@ -586,7 +587,7 @@ bool ChannelScanSM::TestNextProgramEncryption(void) .arg(cur_chan).arg(pnum); scan_monitor->ScanAppendTextToLog(msg_tr); - VERBOSE(VB_CHANSCAN, msg); + LOG(VB_CHANSCAN, LOG_INFO, msg); #ifdef USING_DVB if (GetDVBChannel()) @@ -600,8 +601,8 @@ bool ChannelScanSM::TestNextProgramEncryption(void) return true; } - VERBOSE(VB_IMPORTANT, LOC + - QString("Can't monitor decryption of program %1 -- no pmt") + LOG(VB_GENERAL, LOG_INFO, + QString("Can't monitor decryption of program %1 -- no pmt") .arg(pnum)); } while (true); @@ -681,8 +682,8 @@ void ChannelScanSM::UpdateScanTransports(const NetworkInformationTable *nit) break; } default: - VERBOSE(VB_CHANSCAN, LOC + - "unknown delivery system descriptor"); + LOG(VB_CHANSCAN, LOG_ERR, + "unknown delivery system descriptor"); continue; } @@ -816,7 +817,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete) } if (transport_tune_complete) { - VERBOSE(VB_CHANSCAN, + LOG(VB_CHANSCAN, LOG_INFO, QString("transport_tune_complete: " "\n\t\t\tcurrentInfo->pmts.empty(): %1" "\n\t\t\tsd->HasCachedAnyNIT(): %2" @@ -833,7 +834,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete) transport_tune_complete |= !wait_until_complete; if (transport_tune_complete) { - VERBOSE(VB_CHANSCAN, + LOG(VB_CHANSCAN, LOG_INFO, QString("transport_tune_complete: wait_until_complete %1") .arg(wait_until_complete)); } @@ -868,7 +869,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete) msg = msg + " -- Unknown decryption status"; scan_monitor->ScanAppendTextToLog(msg_tr); - VERBOSE(VB_CHANSCAN, msg); + LOG(VB_CHANSCAN, LOG_INFO, msg); } } @@ -898,7 +899,8 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete) if (currentInfo && !currentInfo->IsEmpty()) { - VERBOSE(VB_CHANSCAN, QString("Adding %1, offset %2 to channelList.") + LOG(VB_CHANSCAN, LOG_INFO, + QString("Adding %1, offset %2 to channelList.") .arg((*current).tuning.toString()).arg(current.offset())); channelList << ChannelListItem(current, currentInfo); currentInfo = NULL; @@ -938,7 +940,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete) } scan_monitor->ScanAppendTextToLog(msg_tr); - VERBOSE(VB_CHANSCAN, LOC + msg); + LOG(VB_CHANSCAN, LOG_INFO, msg); currentEncryptionStatus.clear(); currentEncryptionStatusChecked.clear(); @@ -1066,8 +1068,8 @@ static void update_info(ChannelInsertInfo &info, if (def_auth) { DefaultAuthorityDescriptor authority(def_auth); - VERBOSE(VB_CHANSCAN, QString("found default authority(SDT) " - "for service %1 %2 %3") + LOG(VB_CHANSCAN, LOG_INFO, + QString("found default authority(SDT) for service %1 %2 %3") .arg(info.orig_netid).arg(info.sdt_tsid).arg(info.service_id)); info.default_authority = authority.DefaultAuthority(); } @@ -1442,7 +1444,7 @@ void ChannelScanSM::StartScanner(void) */ void ChannelScanSM::RunScanner(void) { - VERBOSE(VB_CHANSCAN, LOC + "ChannelScanSM::RunScanner -- begin"); + LOG(VB_CHANSCAN, LOG_INFO, "ChannelScanSM::RunScanner -- begin"); while (!threadExit) { @@ -1452,7 +1454,7 @@ void ChannelScanSM::RunScanner(void) usleep(10 * 1000); } - VERBOSE(VB_CHANSCAN, LOC + "ChannelScanSM::RunScanner -- end"); + LOG(VB_CHANSCAN, LOG_INFO, "ChannelScanSM::RunScanner -- end"); } // See if we have timed out @@ -1580,7 +1582,7 @@ void ChannelScanSM::HandleActiveScan(void) { QString name = QString("TransportID %1").arg(it.key() & 0xffff); TransportScanItem item(sourceID, name, *it, signalTimeout); - VERBOSE(VB_CHANSCAN, LOC + "Adding " + name + " - " + + LOG(VB_CHANSCAN, LOG_INFO, "Adding " + name + " - " + item.tuning.toString()); scanTransports.push_back(item); ts_scanned.insert(it.key()); @@ -1650,13 +1652,13 @@ void ChannelScanSM::ScanTransport(const transport_scan_items_it_t transport) } scan_monitor->ScanUpdateStatusText(cur_chan); - VERBOSE(VB_CHANSCAN, LOC + tune_msg_str); + LOG(VB_CHANSCAN, LOG_INFO, tune_msg_str); if (!Tune(transport)) { // If we did not tune successfully, bail with message UpdateScanPercentCompleted(); - VERBOSE(VB_CHANSCAN, LOC + - QString("Failed to tune %1 mplexid(%2) at offset %3") + LOG(VB_CHANSCAN, LOG_ERR, + QString("Failed to tune %1 mplexid(%2) at offset %3") .arg(item.FriendlyName).arg(item.mplexid) .arg(transport.offset())); return; @@ -1682,7 +1684,7 @@ void ChannelScanSM::ScanTransport(const transport_scan_items_it_t transport) */ void ChannelScanSM::StopScanner(void) { - VERBOSE(VB_CHANSCAN, LOC + "ChannelScanSM::StopScanner"); + LOG(VB_CHANSCAN, LOG_INFO, "ChannelScanSM::StopScanner"); while (scannerThread) { @@ -1726,8 +1728,8 @@ bool ChannelScanSM::ScanTransports( .arg(std).arg(modulation).arg(country); scan_monitor->ScanAppendTextToLog(msg); } - VERBOSE(VB_CHANSCAN, LOC + - QString("Looked up freq table (%1, %2, %3) w/%4 entries") + LOG(VB_CHANSCAN, LOG_INFO, + QString("Looked up freq table (%1, %2, %3) w/%4 entries") .arg(std).arg(modulation).arg(country).arg(tables.size())); QString start = table_start; @@ -1753,7 +1755,7 @@ bool ChannelScanSM::ScanTransports( freq, ft, signalTimeout); scanTransports.push_back(item); - VERBOSE(VB_CHANSCAN, LOC + item.toString()); + LOG(VB_CHANSCAN, LOG_INFO, item.toString()); } name_num++; @@ -1804,12 +1806,12 @@ bool ChannelScanSM::ScanForChannels(uint sourceid, scanTransports.push_back(item); - VERBOSE(VB_CHANSCAN, LOC + item.toString()); + LOG(VB_CHANSCAN, LOG_INFO, item.toString()); } if (scanTransports.empty()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "ScanForChannels() no transports"); + LOG(VB_GENERAL, LOG_ERR, "ScanForChannels() no transports"); return false; } @@ -1907,7 +1909,7 @@ bool ChannelScanSM::AddToList(uint mplexid) if (!query.next()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "AddToList() " + + LOG(VB_GENERAL, LOG_ERR, "AddToList() " + QString("Failed to locate mplexid(%1) in DB").arg(mplexid)); return false; } @@ -1944,12 +1946,12 @@ bool ChannelScanSM::AddToList(uint mplexid) if (item.tuning.FillFromDB(tt, mplexid)) { - VERBOSE(VB_CHANSCAN, LOC + "Adding " + fn); + LOG(VB_CHANSCAN, LOG_INFO, "Adding " + fn); scanTransports.push_back(item); return true; } - VERBOSE(VB_CHANSCAN, LOC + "Not adding incomplete transport " + fn); + LOG(VB_CHANSCAN, LOG_INFO, "Not adding incomplete transport " + fn); return false; } @@ -2010,7 +2012,7 @@ bool ChannelScanSM::CheckImportedList( bool found = false; for (uint i = 0; i < channels.size(); i++) { - VERBOSE(VB_IMPORTANT, + LOG(VB_GENERAL, LOG_DEBUG, QString("comparing %1 %2 against %3 %4") .arg(channels[i].serviceid).arg(channels[i].name) .arg(mpeg_program_num).arg(common_status_info)); diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner.cpp index 977c1d79683..53a0838a4ae 100644 --- a/mythtv/libs/libmythtv/channelscan/channelscanner.cpp +++ b/mythtv/libs/libmythtv/channelscan/channelscanner.cpp @@ -120,12 +120,11 @@ void ChannelScanner::Scan( PreScanCommon(scantype, cardid, inputname, sourceid, do_ignore_signal_timeout, do_test_decryption); - VERBOSE(VB_CHANSCAN, LOC + "Scan()"); + LOG(VB_CHANSCAN, LOG_INFO, "Scan()"); if (!sigmonScanner) { - VERBOSE(VB_CHANSCAN, LOC + "Scan(): " - "scanner does not exist..."); + LOG(VB_CHANSCAN, LOG_ERR, "Scan(): scanner does not exist..."); return; } @@ -139,8 +138,7 @@ void ChannelScanner::Scan( (ScanTypeSetting::FullScan_DVBT == scantype) || (ScanTypeSetting::FullScan_Analog == scantype)) { - VERBOSE(VB_CHANSCAN, LOC + - QString("ScanTransports(%1, %2, %3)") + LOG(VB_CHANSCAN, LOG_INFO, QString("ScanTransports(%1, %2, %3)") .arg(freq_std).arg(mod).arg(tbl)); // HACK HACK HACK -- begin @@ -162,13 +160,13 @@ void ChannelScanner::Scan( (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || (ScanTypeSetting::NITAddScan_DVBC == scantype)) { - VERBOSE(VB_CHANSCAN, LOC + "ScanTransports()"); + LOG(VB_CHANSCAN, LOG_INFO, "ScanTransports()"); ok = sigmonScanner->ScanTransportsStartingOn(sourceid, startChan); } else if (ScanTypeSetting::FullTransportScan == scantype) { - VERBOSE(VB_CHANSCAN, LOC + QString("ScanExistingTransports(%1)") + LOG(VB_CHANSCAN, LOG_INFO, QString("ScanExistingTransports(%1)") .arg(sourceid)); ok = sigmonScanner->ScanExistingTransports(sourceid, do_follow_nit); @@ -186,7 +184,8 @@ void ChannelScanner::Scan( { ok = true; - VERBOSE(VB_CHANSCAN, LOC + QString("ScanForChannels(%1)").arg(sourceid)); + LOG(VB_CHANSCAN, LOG_INFO, + QString("ScanForChannels(%1)").arg(sourceid)); QString card_type = CardUtil::GetRawCardType(cardid); QString sub_type = card_type; @@ -216,20 +215,20 @@ void ChannelScanner::Scan( } else if (ScanTypeSetting::TransportScan == scantype) { - VERBOSE(VB_CHANSCAN, LOC + QString("ScanTransport(%1)").arg(mplexid)); + LOG(VB_CHANSCAN, LOG_INFO, QString("ScanTransport(%1)").arg(mplexid)); ok = sigmonScanner->ScanTransport(mplexid, do_follow_nit); } else if (ScanTypeSetting::CurrentTransportScan == scantype) { QString sistandard = "mpeg"; - VERBOSE(VB_CHANSCAN, LOC + "ScanCurrentTransport(" + sistandard + ")"); + LOG(VB_CHANSCAN, LOG_INFO, "ScanCurrentTransport(" + sistandard + ")"); ok = sigmonScanner->ScanCurrentTransport(sistandard); } if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to handle tune complete."); + LOG(VB_GENERAL, LOG_ERR, "Failed to handle tune complete."); InformUser(QObject::tr("Programmer Error: " "Failed to handle tune complete.")); } @@ -313,7 +312,7 @@ void ChannelScanner::PreScanCommon( QString device = CardUtil::GetVideoDevice(cardid); if (device.isEmpty()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "No Device"); + LOG(VB_GENERAL, LOG_ERR, "No Device"); InformUser(QObject::tr("Programmer Error: No Device")); return; } @@ -373,7 +372,7 @@ void ChannelScanner::PreScanCommon( if (!channel) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Channel not created"); + LOG(VB_GENERAL, LOG_ERR, "Channel not created"); InformUser(QObject::tr("Programmer Error: Channel not created")); return; } @@ -384,7 +383,7 @@ void ChannelScanner::PreScanCommon( // If the backend is running this may fail... if (!channel->Open()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Channel could not be opened"); + LOG(VB_GENERAL, LOG_ERR, "Channel could not be opened"); InformUser(QObject::tr("Channel could not be opened.")); return; } diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp index 522c54c8f3a..8f13e2fff8e 100644 --- a/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp +++ b/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp @@ -110,7 +110,7 @@ void ChannelScannerCLI::HandleEvent(const ScannerEvent *scanEvent) static QString old_msg; if (msg != old_msg) { - VERBOSE(VB_CHANSCAN, LOC + msg); + LOG(VB_CHANSCAN, LOG_INFO, msg); old_msg = msg; } } @@ -131,7 +131,7 @@ void ChannelScannerCLI::InformUser(const QString &error) } else { - VERBOSE(VB_IMPORTANT, LOC_ERR + error); + LOG(VB_GENERAL, LOG_ERR, error); } post_event(scanMonitor, ScannerEvent::ScanComplete, 0); } diff --git a/mythtv/libs/libmythtv/channelscan/scaninfo.cpp b/mythtv/libs/libmythtv/channelscan/scaninfo.cpp index 3da6608062a..37c95142431 100644 --- a/mythtv/libs/libmythtv/channelscan/scaninfo.cpp +++ b/mythtv/libs/libmythtv/channelscan/scaninfo.cpp @@ -21,7 +21,7 @@ ScanInfo::ScanInfo(uint _scanid, uint _cardid, uint _sourceid, uint SaveScan(const ScanDTVTransportList &scan) { - VERBOSE(VB_CHANSCAN, QString("SaveScan() scan.size(): %1") + LOG(VB_CHANSCAN, LOG_INFO, QString("SaveScan() scan.size(): %1") .arg(scan.size())); uint scanid = 0; diff --git a/mythtv/libs/libmythtv/channelsettings.h b/mythtv/libs/libmythtv/channelsettings.h index 63f608b173f..381ee448059 100644 --- a/mythtv/libs/libmythtv/channelsettings.h +++ b/mythtv/libs/libmythtv/channelsettings.h @@ -59,7 +59,7 @@ class ChannelID : public IntegerSetting, public TransientStorage if (query.numRowsAffected() != 1) { - VERBOSE(VB_IMPORTANT, QString("ChannelID, Error: ") + + LOG(VB_GENERAL, LOG_ERR, QString("ChannelID, Error: ") + QString("Failed to insert into: %1").arg(table)); } } diff --git a/mythtv/libs/libmythtv/channelutil.cpp b/mythtv/libs/libmythtv/channelutil.cpp index 81aa4c79887..436575d6f23 100644 --- a/mythtv/libs/libmythtv/channelutil.cpp +++ b/mythtv/libs/libmythtv/channelutil.cpp @@ -96,7 +96,7 @@ static uint insert_dtv_multiplex( // DVB specific transport_id, network_id, polarity); - VERBOSE(VB_CHANSCAN, QString( + LOG(VB_CHANSCAN, LOG_INFO, QString( "insert_dtv_multiplex(db_source_id: %1, sistandard: '%2', " "frequency: %3, modulation: %4, transport_id: %5, " "network_id: %6, polarity: %7...) mplexid:%8") @@ -270,7 +270,7 @@ static uint insert_dtv_multiplex( // DVB specific transport_id, network_id, polarity); - VERBOSE(VB_CHANSCAN, QString("insert_dtv_multiplex -- ") + + LOG(VB_CHANSCAN, LOG_INFO, QString("insert_dtv_multiplex -- ") + QString("inserted %1").arg(mplex)); return mplex; @@ -610,8 +610,8 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, int transport_id, int network_id) { - VERBOSE(VB_CHANSCAN, - QString("GetBetterMplexID(mplexId %1, tId %2, netId %3)") + LOG(VB_CHANSCAN, LOG_INFO, + QString("GetBetterMplexID(mplexId %1, tId %2, netId %3)") .arg(current_mplexid).arg(transport_id).arg(network_id)); int q_networkid = 0, q_transportid = 0; @@ -633,8 +633,8 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, // Got a match, return it. if ((q_networkid == network_id) && (q_transportid == transport_id)) { - VERBOSE(VB_CHANSCAN, - QString("GetBetterMplexID(): Returning perfect match %1") + LOG(VB_CHANSCAN, LOG_INFO, + QString("GetBetterMplexID(): Returning perfect match %1") .arg(current_mplexid)); return current_mplexid; } @@ -651,8 +651,8 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, if (!query.exec() || !query.isActive()) MythDB::DBError("Getting mplexid global search", query); - VERBOSE(VB_CHANSCAN, QString( - "GetBetterMplexID(): net id and transport id " + LOG(VB_CHANSCAN, LOG_INFO, + QString("GetBetterMplexID(): net id and transport id " "are null, qsize(%1), Returning %2") .arg(qsize).arg(current_mplexid)); return current_mplexid; @@ -685,8 +685,8 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, if (query.size() == 1) { - VERBOSE(VB_CHANSCAN, QString( - "GetBetterMplexID(): query#%1 qsize(%2) " + LOG(VB_CHANSCAN, LOG_INFO, + QString("GetBetterMplexID(): query#%1 qsize(%2) " "Returning %3") .arg(i).arg(query.size()).arg(current_mplexid)); query.next(); @@ -697,8 +697,8 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, { query.next(); int ret = (i==0) ? current_mplexid : query.value(0).toInt(); - VERBOSE(VB_CHANSCAN, QString( - "GetBetterMplexID(): query#%1 qsize(%2) " + LOG(VB_CHANSCAN, LOG_INFO, + QString("GetBetterMplexID(): query#%1 qsize(%2) " "Returning %3") .arg(i).arg(query.size()).arg(ret)); return ret; @@ -706,7 +706,7 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, } // If you still didn't find this combo return -1 (failure) - VERBOSE(VB_CHANSCAN, "GetBetterMplexID(): Returning -1"); + LOG(VB_CHANSCAN, LOG_INFO, "GetBetterMplexID(): Returning -1"); return -1; } @@ -1070,7 +1070,7 @@ bool ChannelUtil::IsOnSameMultiplex(uint srcid, if (!new_mplexid) return false; - VERBOSE(VB_CHANNEL, QString("IsOnSameMultiplex? %1==%2 -> %3") + LOG(VB_CHANNEL, LOG_INFO, QString("IsOnSameMultiplex? %1==%2 -> %3") .arg(old_mplexid).arg(new_mplexid) .arg(old_mplexid == new_mplexid)); @@ -1465,7 +1465,7 @@ static uint get_max_chanid(uint sourceid) if (!query.exec() || !query.isActive()) MythDB::DBError("Getting chanid for new channel (2)", query); else if (!query.next()) - VERBOSE(VB_IMPORTANT, "Error getting chanid for new channel."); + LOG(VB_GENERAL, LOG_ERR, "Error getting chanid for new channel."); else return query.value(0).toUInt(); @@ -1718,8 +1718,9 @@ void ChannelUtil::UpdateInsertInfoFromDB(ChannelInsertInfo &chan) if (!xmltvid.isEmpty()) { if (useeit) - VERBOSE(VB_GENERAL, "Using EIT and xmltv for the same channel " - "is a unsupported configuration."); + LOG(VB_GENERAL, LOG_ERR, + "Using EIT and xmltv for the same channel " + "is a unsupported configuration."); chan.xmltvid = xmltvid; chan.use_on_air_guide = useeit; } @@ -1867,8 +1868,8 @@ bool ChannelUtil::GetChannelData( } else if (!query.next()) { - VERBOSE(VB_IMPORTANT, QString( - "GetChannelData() failed because it could not\n" + LOG(VB_GENERAL, LOG_ERR, + QString("GetChannelData() failed because it could not\n" "\t\t\tfind channel number '%1' in DB for source '%2'.") .arg(channum).arg(sourceid)); return false; @@ -1936,8 +1937,8 @@ bool ChannelUtil::GetExtendedChannelData( } else if (!query.next()) { - VERBOSE(VB_IMPORTANT, QString( - "GetChannelData() failed because it could not\n" + LOG(VB_GENERAL, LOG_ERR, + QString("GetChannelData() failed because it could not\n" "\t\t\tfind channel number '%1' in DB for source '%2'.") .arg(channum).arg(sourceid)); return false; diff --git a/mythtv/libs/libmythtv/commbreakmap.cpp b/mythtv/libs/libmythtv/commbreakmap.cpp index 312017b68f4..ff6f21eba8f 100644 --- a/mythtv/libs/libmythtv/commbreakmap.cpp +++ b/mythtv/libs/libmythtv/commbreakmap.cpp @@ -87,8 +87,8 @@ void CommBreakMap::SetTracker(uint64_t framesPlayed) if (commBreakIter != commBreakMap.end()) { - VERBOSE(VB_COMMFLAG, LOC + QString("new commBreakIter = %1 @ frame %2, " - "framesPlayed = %3") + LOG(VB_COMMFLAG, LOG_INFO, + QString("new commBreakIter = %1 @ frame %2, framesPlayed = %3") .arg(*commBreakIter).arg(commBreakIter.key()) .arg(framesPlayed)); } @@ -138,8 +138,8 @@ bool CommBreakMap::IsInCommBreak(uint64_t frameNumber) void CommBreakMap::SetMap(const frm_dir_map_t &newMap, uint64_t framesPlayed) { QMutexLocker locker(&commBreakMapLock); - VERBOSE(VB_COMMFLAG, - QString("Setting New Commercial Break List, old size %1, new %2") + LOG(VB_COMMFLAG, LOG_INFO, + QString("Setting New Commercial Break List, old size %1, new %2") .arg(commBreakMap.size()).arg(newMap.size())); commBreakMap.clear(); @@ -185,10 +185,9 @@ bool CommBreakMap::AutoCommercialSkip(uint64_t &jumpToFrame, return false; } - VERBOSE(VB_COMMFLAG, LOC + QString("AutoCommercialSkip(), current " - "framesPlayed %1, commBreakIter " - "frame %2, incrementing " - "commBreakIter") + LOG(VB_COMMFLAG, LOG_INFO, + QString("AutoCommercialSkip(), current framesPlayed %1, commBreakIter " + "frame %2, incrementing commBreakIter") .arg(framesPlayed).arg(commBreakIter.key())); ++commBreakIter; @@ -197,28 +196,28 @@ bool CommBreakMap::AutoCommercialSkip(uint64_t &jumpToFrame, if (commBreakIter == commBreakMap.end()) { - VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), at " - "end of commercial break list, will not skip."); + LOG(VB_COMMFLAG, LOG_INFO, "AutoCommercialSkip(), at end of commercial " + "break list, will not skip."); return false; } if (*commBreakIter == MARK_COMM_START) { - VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), new " - "commBreakIter mark is another start, will not skip."); + LOG(VB_COMMFLAG, LOG_INFO, "AutoCommercialSkip(), new commBreakIter " + "mark is another start, will not skip."); return false; } if (totalFrames && ((commBreakIter.key() + (10 * video_frame_rate)) > totalFrames)) { - VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), skipping " - "would take us to the end of the file, will not skip."); + LOG(VB_COMMFLAG, LOG_INFO, "AutoCommercialSkip(), skipping would take " + "us to the end of the file, will not skip."); return false; } - VERBOSE(VB_COMMFLAG, LOC + QString("AutoCommercialSkip(), new " - "commBreakIter frame %1") + LOG(VB_COMMFLAG, LOG_INFO, + QString("AutoCommercialSkip(), new commBreakIter frame %1") .arg(commBreakIter.key())); int skipped_seconds = (int)((commBreakIter.key() - @@ -233,8 +232,8 @@ bool CommBreakMap::AutoCommercialSkip(uint64_t &jumpToFrame, if (kCommSkipOn == autocommercialskip) { - VERBOSE(VB_COMMFLAG, LOC + QString("AutoCommercialSkip(), " - "auto-skipping to frame %1") + LOG(VB_COMMFLAG, LOG_INFO, + QString("AutoCommercialSkip(), auto-skipping to frame %1") .arg(commBreakIter.key() - (int)(commrewindamount * video_frame_rate))); diff --git a/mythtv/libs/libmythtv/darwinavcinfo.cpp b/mythtv/libs/libmythtv/darwinavcinfo.cpp index 82d5eacf868..1fbde6a4918 100644 --- a/mythtv/libs/libmythtv/darwinavcinfo.cpp +++ b/mythtv/libs/libmythtv/darwinavcinfo.cpp @@ -97,14 +97,14 @@ void DarwinAVCInfo::Update(uint64_t _guid, DarwinFirewireDevice *dev, ////////////////////////// // get subunit info - VERBOSE(VB_RECORD, QString("Scanning guid: 0x%1").arg(guid, 0, 16)); + LOG(VB_RECORD, LOG_INFO, QString("Scanning guid: 0x%1").arg(guid, 0, 16)); bool wasOpen = IsAVCInterfaceOpen(); if (OpenAVCInterface(thread_cf_ref)) { if (!GetSubunitInfo()) { - VERBOSE(VB_IMPORTANT, "GetSubunitInfo failed"); + LOG(VB_GENERAL, LOG_ERR, "GetSubunitInfo failed"); } if (!wasOpen) diff --git a/mythtv/libs/libmythtv/darwinfirewiredevice.cpp b/mythtv/libs/libmythtv/darwinfirewiredevice.cpp index 510466cb5ad..f9ef651d8a0 100644 --- a/mythtv/libs/libmythtv/darwinfirewiredevice.cpp +++ b/mythtv/libs/libmythtv/darwinfirewiredevice.cpp @@ -128,7 +128,7 @@ DarwinFirewireDevice::~DarwinFirewireDevice() { if (IsPortOpen()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "ctor called with open port"); + LOG(VB_GENERAL, LOG_ERR, "ctor called with open port"); while (IsPortOpen()) ClosePort(); } @@ -229,7 +229,7 @@ bool DarwinFirewireDevice::OpenPort(void) { QMutexLocker locker(&m_lock); - VERBOSE(VB_RECORD, LOC + "OpenPort()"); + LOG(VB_RECORD, LOG_INFO, "OpenPort()"); if (GetInfoPtr() && GetInfoPtr()->IsPortOpen()) { @@ -241,25 +241,25 @@ bool DarwinFirewireDevice::OpenPort(void) if (!m_priv->controller_thread_running) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to start firewire thread."); + LOG(VB_GENERAL, LOG_ERR, "Unable to start firewire thread."); return false; } if (!GetInfoPtr()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "No IEEE-1394 device with our GUID"); + LOG(VB_GENERAL, LOG_ERR, "No IEEE-1394 device with our GUID"); StopController(); return false; } - VERBOSE(VB_RECORD, LOC + "Opening AVC Device"); - VERBOSE(VB_RECORD, LOC + GetInfoPtr()->GetSubunitInfoString()); + LOG(VB_RECORD, LOG_INFO, "Opening AVC Device"); + LOG(VB_RECORD, LOG_INFO, GetInfoPtr()->GetSubunitInfoString()); if (!GetInfoPtr()->IsSubunitType(kAVCSubunitTypeTuner) || !GetInfoPtr()->IsSubunitType(kAVCSubunitTypePanel)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("No STB at guid: 0x%1") + LOG(VB_GENERAL, LOG_ERR, QString("No STB at guid: 0x%1") .arg(m_guid,0,16)); StopController(); @@ -269,7 +269,7 @@ bool DarwinFirewireDevice::OpenPort(void) bool ok = GetInfoPtr()->OpenPort(m_priv->controller_thread_cf_ref); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to get handle for port"); + LOG(VB_GENERAL, LOG_ERR, "Unable to get handle for port"); return false; } @@ -279,13 +279,13 @@ bool DarwinFirewireDevice::OpenPort(void) { if (m_local_node < 0) { - VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to query local node"); + LOG(VB_GENERAL, LOG_WARNING, "Failed to query local node"); m_local_node = 0; } if (m_remote_node < 0) { - VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to query remote node"); + LOG(VB_GENERAL, LOG_WARNING, "Failed to query remote node"); m_remote_node = 0; } } @@ -299,7 +299,7 @@ bool DarwinFirewireDevice::ClosePort(void) { QMutexLocker locker(&m_lock); - VERBOSE(VB_RECORD, LOC + "ClosePort()"); + LOG(VB_RECORD, LOG_INFO, "ClosePort()"); if (m_open_port_cnt < 1) return false; @@ -311,7 +311,7 @@ bool DarwinFirewireDevice::ClosePort(void) if (GetInfoPtr() && GetInfoPtr()->IsPortOpen()) { - VERBOSE(VB_RECORD, LOC + "Closing AVC Device"); + LOG(VB_RECORD, LOG_INFO, "Closing AVC Device"); GetInfoPtr()->ClosePort(); } @@ -329,13 +329,14 @@ bool DarwinFirewireDevice::OpenAVStream(void) return true; int max_speed = GetMaxSpeed(); - VERBOSE(VB_IMPORTANT, QString("Max Speed: %1, Our speed: %2") + LOG(VB_GENERAL, LOG_INFO, QString("Max Speed: %1, Our speed: %2") .arg(max_speed).arg(m_speed)); m_speed = min((uint)max_speed, m_speed); uint fwchan = 0; bool streaming = IsSTBStreaming(&fwchan); - VERBOSE(VB_IMPORTANT, QString("STB is %1already streaming on fwchan: %2") + LOG(VB_GENERAL, LOG_INFO, + QString("STB is %1already streaming on fwchan: %2") .arg(streaming?"":"not ").arg(fwchan)); // TODO we should use the stream if it already exists, @@ -353,7 +354,7 @@ bool DarwinFirewireDevice::OpenAVStream(void) if (kIOReturnSuccess != ret) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Couldn't create A/V stream object"); + LOG(VB_GENERAL, LOG_ERR, "Couldn't create A/V stream object"); return false; } @@ -423,7 +424,7 @@ bool DarwinFirewireDevice::CloseAVStream(void) StopStreaming(); - VERBOSE(VB_RECORD, LOC + "Destroying A/V stream object"); + LOG(VB_RECORD, LOG_INFO, "Destroying A/V stream object"); AVS::DestroyMPEG2Receiver(m_priv->avstream); m_priv->avstream = NULL; @@ -437,7 +438,7 @@ bool DarwinFirewireDevice::IsAVStreamOpen(void) const bool DarwinFirewireDevice::ResetBus(void) { - VERBOSE(VB_IMPORTANT, LOC + "ResetBus() -- begin"); + LOG(VB_GENERAL, LOG_DEBUG, "ResetBus() -- begin"); if (!GetInfoPtr() || !GetInfoPtr()->fw_handle) return false; @@ -446,9 +447,9 @@ bool DarwinFirewireDevice::ResetBus(void) bool ok = (*fw_handle)->BusReset(fw_handle) == kIOReturnSuccess; if (!ok) - VERBOSE(VB_IMPORTANT, LOC_ERR + "Bus Reset failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "Bus Reset failed" + ENO); - VERBOSE(VB_IMPORTANT, LOC + "ResetBus() -- end"); + LOG(VB_GENERAL, LOG_DEBUG, "ResetBus() -- end"); return ok; } @@ -458,11 +459,11 @@ bool DarwinFirewireDevice::StartStreaming(void) if (m_priv->is_streaming) return m_priv->is_streaming; - VERBOSE(VB_RECORD, LOC + "Starting A/V streaming"); + LOG(VB_RECORD, LOG_INFO, "Starting A/V streaming"); if (!IsAVStreamOpen() && !OpenAVStream()) { - VERBOSE(VB_IMPORTANT, LOC + "Starting A/V streaming: FAILED"); + LOG(VB_GENERAL, LOG_ERR, "Starting A/V streaming: FAILED"); return false; } @@ -472,7 +473,7 @@ bool DarwinFirewireDevice::StartStreaming(void) m_priv->is_streaming = (kIOReturnSuccess == ret); - VERBOSE(VB_IMPORTANT, (LOC + "Starting A/V streaming: %1") + LOG(VB_GENERAL, LOG_INFO, QString("Starting A/V streaming: %1") .arg((m_priv->is_streaming)?"success":"failure")); return m_priv->is_streaming; @@ -483,18 +484,18 @@ bool DarwinFirewireDevice::StopStreaming(void) if (!m_priv->is_streaming) return true; - VERBOSE(VB_RECORD, LOC + "Stopping A/V streaming"); + LOG(VB_RECORD, LOG_INFO, "Stopping A/V streaming"); bool ok = (kIOReturnSuccess == m_priv->avstream->stopReceive()); m_priv->is_streaming = !ok; if (!ok) { - VERBOSE(VB_RECORD, LOC_ERR + "Failed to stop A/V streaming"); + LOG(VB_RECORD, LOG_ERR, "Failed to stop A/V streaming"); return false; } - VERBOSE(VB_RECORD, LOC + "Stopped A/V streaming"); + LOG(VB_RECORD, LOG_INFO, "Stopped A/V streaming"); return true; } @@ -556,7 +557,7 @@ void DarwinFirewireDevice::ProcessNoDataMessage(void) m_priv->no_data_timer_set = true; m_priv->no_data_timer.start(); - VERBOSE(VB_IMPORTANT, LOC_WARN + QString("No Input in %1 msecs") + LOG(VB_GENERAL, LOG_WARNING, QString("No Input in %1 msecs") .arg(m_priv->no_data_cnt * kNoDataTimeout)); if (m_priv->no_data_cnt > (kResetTimeout / kNoDataTimeout)) @@ -579,28 +580,27 @@ void DarwinFirewireDevice::ProcessStreamingMessage( bool ok = UpdatePlugRegister( plug_number, fw_channel, speed, true, false); - VERBOSE(VB_IMPORTANT, LOC + QString("AllocateIsochPort(%1,%2) %3") + LOG(VB_GENERAL, LOG_INFO, QString("AllocateIsochPort(%1,%2) %3") .arg(fw_channel).arg(speed).arg(((ok)?"ok":"error"))); } else if (AVS::kMpeg2ReceiverReleaseIsochPort == msg) { int ret = UpdatePlugRegister(plug_number, -1, -1, false, true); - VERBOSE(VB_IMPORTANT, (LOC + "ReleaseIsochPort %1") + LOG(VB_GENERAL, LOG_INFO, QString("ReleaseIsochPort %1") .arg((kIOReturnSuccess == ret)?"ok":"error")); } else if (AVS::kMpeg2ReceiverDCLOverrun == msg) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "DCL Overrun"); + LOG(VB_GENERAL, LOG_ERR, "DCL Overrun"); } else if (AVS::kMpeg2ReceiverReceivedBadPacket == msg) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Received Bad Packet"); + LOG(VB_GENERAL, LOG_ERR, "Received Bad Packet"); } else { - VERBOSE(VB_GENERAL, LOC + - QString("Streaming Message: %1").arg(msg)); + LOG(VB_GENERAL, LOG_INFO, QString("Streaming Message: %1").arg(msg)); } } @@ -627,9 +627,13 @@ vector DarwinFirewireDevice::GetSTBList(void) vector DarwinFirewireDevice::GetSTBListPrivate(void) { - //VERBOSE(VB_IMPORTANT, "GetSTBListPrivate -- begin"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "GetSTBListPrivate -- begin"); +#endif QMutexLocker locker(&m_lock); - //VERBOSE(VB_IMPORTANT, "GetSTBListPrivate -- got lock"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "GetSTBListPrivate -- got lock"); +#endif vector list; @@ -643,7 +647,9 @@ vector DarwinFirewireDevice::GetSTBListPrivate(void) } } - //VERBOSE(VB_IMPORTANT, "GetSTBListPrivate -- end"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "GetSTBListPrivate -- end"); +#endif return list; } @@ -657,7 +663,7 @@ void DarwinFirewireDevice::UpdateDeviceListItem(uint64_t guid, void *pitem) { DarwinAVCInfo *ptr = new DarwinAVCInfo(); - VERBOSE(VB_IMPORTANT, QString("Adding 0x%1").arg(guid, 0, 16)); + LOG(VB_GENERAL, LOG_INFO, QString("Adding 0x%1").arg(guid, 0, 16)); m_priv->devices[guid] = ptr; it = m_priv->devices.find(guid); @@ -666,7 +672,7 @@ void DarwinFirewireDevice::UpdateDeviceListItem(uint64_t guid, void *pitem) io_object_t &item = *((io_object_t*) pitem); if (it != m_priv->devices.end()) { - VERBOSE(VB_IMPORTANT, QString("Updating 0x%1").arg(guid, 0, 16)); + LOG(VB_GENERAL, LOG_INFO, QString("Updating 0x%1").arg(guid, 0, 16)); (*it)->Update(guid, this, m_priv->notify_port, m_priv->controller_thread_cf_ref, item); } @@ -716,7 +722,7 @@ bool DarwinFirewireDevice::UpdatePlugRegisterPrivate( new_plug_cnt += ((add_plug) ? 1 : 0) - ((remove_plug) ? 1 : 0); if ((new_plug_cnt > 0x3f) || (new_plug_cnt < 0)) { - VERBOSE(VB_IMPORTANT, (LOC_ERR + "Invalid Plug Count %1") + LOG(VB_GENERAL, LOG_ERR, QString("Invalid Plug Count %1") .arg(new_plug_cnt)); return false; } @@ -724,7 +730,7 @@ bool DarwinFirewireDevice::UpdatePlugRegisterPrivate( new_fw_chan = (new_fw_chan >= 0) ? new_fw_chan : old_fw_chan; if (old_plug_cnt && (new_fw_chan != old_fw_chan)) { - VERBOSE(VB_IMPORTANT, LOC_WARN + + LOG(VB_GENERAL, LOG_WARNING, "Ignoring FWChan change request, plug already open"); new_fw_chan = old_fw_chan; @@ -733,7 +739,7 @@ bool DarwinFirewireDevice::UpdatePlugRegisterPrivate( new_speed = (new_speed >= 0) ? new_speed : old_speed; if (old_plug_cnt && (new_speed != old_speed)) { - VERBOSE(VB_IMPORTANT, LOC_WARN + + LOG(VB_GENERAL, LOG_WARNING, "Ignoring speed change request, plug already open"); new_speed = old_speed; @@ -771,9 +777,9 @@ void DarwinFirewireDevice::HandleBusReset(void) } if (!ok) - VERBOSE(VB_IMPORTANT, LOC + "Reset: Failed to reconnect"); + LOG(VB_GENERAL, LOG_ERR, "Reset: Failed to reconnect"); else - VERBOSE(VB_RECORD, LOC + "Reset: Reconnected succesfully"); + LOG(VB_RECORD, LOG_INFO, "Reset: Reconnected succesfully"); } bool DarwinFirewireDevice::UpdatePlugRegister( @@ -802,27 +808,27 @@ void DarwinFirewireDevice::HandleDeviceChange(uint messageType) if (kIOMessageServiceIsTerminated == messageType) { - VERBOSE(VB_RECORD, loc + "Disconnect"); + LOG(VB_RECORD, LOG_INFO, loc + "Disconnect"); // stop printing no data messages.. don't try to open return; } if (kIOMessageServiceIsAttemptingOpen == messageType) { - VERBOSE(VB_RECORD, loc + "Attempting open"); + LOG(VB_RECORD, LOG_INFO, loc + "Attempting open"); return; } if (kIOMessageServiceWasClosed == messageType) { - VERBOSE(VB_RECORD, loc + "Device Closed"); + LOG(VB_RECORD, LOG_INFO, loc + "Device Closed"); // fill unit_table return; } if (kIOMessageServiceIsSuspended == messageType) { - VERBOSE(VB_RECORD, loc + "kIOMessageServiceIsSuspended"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceIsSuspended"); // start of reset return; } @@ -834,42 +840,42 @@ void DarwinFirewireDevice::HandleDeviceChange(uint messageType) } if (kIOMessageServiceIsTerminated == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageServiceIsTerminated"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceIsTerminated"); else if (kIOMessageServiceIsRequestingClose == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageServiceIsRequestingClose"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceIsRequestingClose"); else if (kIOMessageServiceIsAttemptingOpen == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageServiceIsAttemptingOpen"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceIsAttemptingOpen"); else if (kIOMessageServiceWasClosed == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageServiceWasClosed"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceWasClosed"); else if (kIOMessageServiceBusyStateChange == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageServiceBusyStateChange"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageServiceBusyStateChange"); else if (kIOMessageCanDevicePowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageCanDevicePowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageCanDevicePowerOff"); else if (kIOMessageDeviceWillPowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageDeviceWillPowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageDeviceWillPowerOff"); else if (kIOMessageDeviceWillNotPowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageDeviceWillNotPowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageDeviceWillNotPowerOff"); else if (kIOMessageDeviceHasPoweredOn == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageDeviceHasPoweredOn"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageDeviceHasPoweredOn"); else if (kIOMessageCanSystemPowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageCanSystemPowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageCanSystemPowerOff"); else if (kIOMessageSystemWillPowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemWillPowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemWillPowerOff"); else if (kIOMessageSystemWillNotPowerOff == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemWillNotPowerOff"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemWillNotPowerOff"); else if (kIOMessageCanSystemSleep == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageCanSystemSleep"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageCanSystemSleep"); else if (kIOMessageSystemWillSleep == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemWillSleep"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemWillSleep"); else if (kIOMessageSystemWillNotSleep == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemWillNotSleep"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemWillNotSleep"); else if (kIOMessageSystemHasPoweredOn == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemHasPoweredOn"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemHasPoweredOn"); else if (kIOMessageSystemWillRestart == messageType) - VERBOSE(VB_RECORD, loc + "kIOMessageSystemWillRestart"); + LOG(VB_RECORD, LOG_INFO, loc + "kIOMessageSystemWillRestart"); else { - VERBOSE(VB_RECORD, (loc + "unknown message 0x%1") + LOG(VB_RECORD, LOG_ERR, loc + QString("unknown message 0x%1") .arg(messageType, 0, 16)); } } @@ -949,5 +955,5 @@ static void dfd_update_device_list(void *dfd, io_iterator_t deviter) static void dfd_streaming_log_message(char *msg) { - VERBOSE(VB_RECORD, QString("MPEG2Receiver: %1").arg(msg)); + LOG(VB_RECORD, LOG_INFO, QString("MPEG2Receiver: %1").arg(msg)); } diff --git a/mythtv/libs/libmythtv/datadirect.cpp b/mythtv/libs/libmythtv/datadirect.cpp index b7ed590cf24..c148ec29afd 100644 --- a/mythtv/libs/libmythtv/datadirect.cpp +++ b/mythtv/libs/libmythtv/datadirect.cpp @@ -423,7 +423,9 @@ bool DDStructureParser::endDocument() bool DDStructureParser::characters(const QString& pchars) { - // VERBOSE(VB_GENERAL, "Characters : " + pchars); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "Characters : " + pchars); +#endif if (pchars.trimmed().isEmpty()) return true; @@ -454,12 +456,12 @@ bool DDStructureParser::characters(const QString& pchars) QDateTime curTime = QDateTime::currentDateTime(); if (curTime.daysTo(EDFM) <= 5) { - VERBOSE(VB_IMPORTANT, LOC + QString("WARNING: ") + + LOG(VB_GENERAL, LOG_WARNING, LOC + QString("WARNING: ") + ExpirationDateMessage); } else { - VERBOSE(VB_IMPORTANT, LOC + ExpirationDateMessage); + LOG(VB_GENERAL, LOG_INFO, LOC + ExpirationDateMessage); } MSqlQuery query(MSqlQuery::DDCon()); @@ -564,7 +566,7 @@ DataDirectProcessor::DataDirectProcessor(uint lp, QString user, QString pass) : DataDirectProcessor::~DataDirectProcessor() { - VERBOSE(VB_GENERAL, LOC + "Deleting temporary files"); + LOG(VB_GENERAL, LOG_INFO, "Deleting temporary files"); if (!tmpPostFile.isEmpty()) { @@ -681,8 +683,8 @@ int DataDirectProcessor::UpdateChannelsSafe( if (!SourceUtil::GetConnectionCount(sourceid)) { - VERBOSE(VB_IMPORTANT, LOC + - QString("Not inserting channels into disconnected source %1.") + LOG(VB_GENERAL, LOG_WARNING, + QString("Not inserting channels into disconnected source %1.") .arg(sourceid)); return -1; } @@ -726,8 +728,8 @@ int DataDirectProcessor::UpdateChannelsSafe( (query.value(5).toUInt() > 0)) { #if 0 - VERBOSE(VB_GENERAL, LOC + QString( - "Not adding channel %1-%2 '%3' (%4),\n\t\t\t" + LOG(VB_GENERAL, LOG_INFO, + QString("Not adding channel %1-%2 '%3' (%4),\n\t\t\t" "looks like a digital channel on an analog source.") .arg(chan_major).arg(chan_minor).arg(name).arg(callsign)); #endif @@ -743,7 +745,7 @@ int DataDirectProcessor::UpdateChannelsSafe( #if 0 if (!insert_channels && !mods) { - VERBOSE(VB_GENERAL, LOC + QString("Not adding channel '%1' (%2).") + LOG(VB_GENERAL, LOG_INFO, QString("Not adding channel '%1' (%2).") .arg(name).arg(callsign)); } #endif @@ -800,8 +802,8 @@ bool DataDirectProcessor::UpdateChannelsUnsafe( (dd_station_info.value(5).toUInt() > 0)) { #if 0 - VERBOSE(VB_GENERAL, LOC + QString( - "Not adding channel %1-%2 '%3' (%4),\n\t\t\t" + LOG(VB_GENERAL, LOG_INFO, + QString("Not adding channel %1-%2 '%3' (%4),\n\t\t\t" "looks like a digital channel on an analog source.") .arg(chan_major).arg(chan_minor) .arg(dd_station_info.value(1).toString()) @@ -833,7 +835,10 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) { MSqlQuery query(MSqlQuery::DDCon()); - //VERBOSE(VB_GENERAL, "Adding rows to main program table from view table"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, + "Adding rows to main program table from view table"); +#endif query.prepare( "INSERT IGNORE INTO program " " ( chanid, starttime, endtime, title, " @@ -870,8 +875,10 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) if (!query.exec()) MythDB::DBError("Inserting into program table", query); - //VERBOSE(VB_GENERAL, "Finished adding rows to main program table"); - //VERBOSE(VB_GENERAL, "Adding program ratings"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "Finished adding rows to main program table"); + LOG(VB_GENERAL, LOG_DEBUG, "Adding program ratings"); +#endif if (!query.exec("INSERT IGNORE INTO programrating (chanid, starttime, " "system, rating) SELECT dd_v_program.chanid, " @@ -890,8 +897,11 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) " AND dd_v_program.chanid = channel.chanid")) MythDB::DBError("Inserting into programrating table", query); - //VERBOSE(VB_GENERAL, "Finished adding program ratings"); - //VERBOSE(VB_GENERAL, "Populating people table from production crew list"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "Finished adding program ratings"); + LOG(VB_GENERAL, LOG_DEBUG, + "Populating people table from production crew list"); +#endif if (!query.exec("INSERT IGNORE INTO people (name) " "SELECT fullname " @@ -901,8 +911,11 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) "WHERE people.name IS NULL;")) MythDB::DBError("Inserting into people table", query); - //VERBOSE(VB_GENERAL, "Finished adding people"); - //VERBOSE(VB_GENERAL, "Adding credits entries from production crew list"); +#if 0 + LOG(VB_GENERAL, LOG_INFO, "Finished adding people"); + LOG(VB_GENERAL, LOG_INFO, + "Adding credits entries from production crew list"); +#endif if (!query.exec("INSERT IGNORE INTO credits (chanid, starttime, person, role)" "SELECT dd_v_program.chanid, " @@ -924,8 +937,10 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) "WHERE credits.role IS NULL;")) MythDB::DBError("Inserting into credits table", query); - //VERBOSE(VB_GENERAL, "Finished inserting credits"); - //VERBOSE(VB_GENERAL, "Adding genres"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "Finished inserting credits"); + LOG(VB_GENERAL, LOG_DEBUG, "Adding genres"); +#endif if (!query.exec("INSERT IGNORE INTO programgenres (chanid, starttime, " "relevance, genre) SELECT dd_v_program.chanid, " @@ -935,7 +950,9 @@ void DataDirectProcessor::DataDirectProgramUpdate(void) "AND dd_v_program.chanid = channel.chanid")) MythDB::DBError("Inserting into programgenres table",query); - //VERBOSE(VB_GENERAL, "Done"); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "Done"); +#endif } bool DataDirectProcessor::DDPost( @@ -1014,7 +1031,7 @@ bool DataDirectProcessor::DDPost( #endif if (SHOW_WGET_OUTPUT) - VERBOSE(VB_GENERAL, "command: " + command); + LOG(VB_GENERAL, LOG_DEBUG, "command: " + command); err_txt = "Returned failure"; if (myth_system(command, kMSAnonLog) != GENERIC_EXIT_OK) @@ -1034,7 +1051,7 @@ bool DataDirectProcessor::DDPost( bool DataDirectProcessor::GrabNextSuggestedTime(void) { - VERBOSE(VB_GENERAL, "Grabbing next suggested grabbing time"); + LOG(VB_GENERAL, LOG_INFO, "Grabbing next suggested grabbing time"); QString ddurl = providers[listings_provider].webServiceURL; @@ -1042,22 +1059,22 @@ bool DataDirectProcessor::GrabNextSuggestedTime(void) QString postFilename = GetPostFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabNextSuggestedTime: " - "Creating temp post file"); + LOG(VB_GENERAL, LOG_ERR, + "GrabNextSuggestedTime: Creating temp post file"); return false; } QString resultFilename = GetResultFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabNextSuggestedTime: " - "Creating temp result file"); + LOG(VB_GENERAL, LOG_ERR, + "GrabNextSuggestedTime: Creating temp result file"); return false; } QFile postfile(postFilename); if (!postfile.open(QIODevice::WriteOnly)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Opening '%1'") + LOG(VB_GENERAL, LOG_ERR, QString("Opening '%1'") .arg(postFilename) + ENO); return false; } @@ -1098,7 +1115,7 @@ bool DataDirectProcessor::GrabNextSuggestedTime(void) } if (SHOW_WGET_OUTPUT) - VERBOSE(VB_GENERAL, "command: " + command); + LOG(VB_GENERAL, LOG_DEBUG, "command: " + command); #ifndef USING_MINGW else command += " 2> /dev/null "; @@ -1131,7 +1148,7 @@ bool DataDirectProcessor::GrabNextSuggestedTime(void) GotNextSuggestedTime = TRUE; QDateTime UTCdt = QDateTime::fromString(tmpStr, Qt::ISODate); NextSuggestedTime = MythUTCToLocal(UTCdt); - VERBOSE(VB_GENERAL, LOC + QString("NextSuggestedTime is: ") + LOG(VB_GENERAL, LOG_INFO, QString("NextSuggestedTime is: ") + NextSuggestedTime.toString(Qt::ISODate)); } @@ -1144,7 +1161,7 @@ bool DataDirectProcessor::GrabNextSuggestedTime(void) GotBlockedTime = TRUE; QDateTime UTCdt = QDateTime::fromString(tmpStr, Qt::ISODate); BlockedTime = MythUTCToLocal(UTCdt); - VERBOSE(VB_GENERAL, LOC + QString("BlockedTime is: ") + LOG(VB_GENERAL, LOG_INFO, QString("BlockedTime is: ") + BlockedTime.toString(Qt::ISODate)); } } @@ -1162,7 +1179,7 @@ bool DataDirectProcessor::GrabData(const QDateTime pstartDate, const QDateTime pendDate) { QString msg = (pstartDate.addSecs(1) == pendDate) ? "channel" : "listing"; - VERBOSE(VB_GENERAL, "Grabbing " + msg + " data"); + LOG(VB_GENERAL, LOG_INFO, "Grabbing " + msg + " data"); QString err = ""; QString ddurl = providers[listings_provider].webServiceURL; @@ -1180,7 +1197,7 @@ bool DataDirectProcessor::GrabData(const QDateTime pstartDate, if (QFile(cache_dd_data).exists() && inputfilename.isEmpty()) { - VERBOSE(VB_GENERAL, LOC + "Using DD cache"); + LOG(VB_GENERAL, LOG_INFO, "Using DD cache"); } if( inputfilename.isEmpty() ) @@ -1191,14 +1208,14 @@ bool DataDirectProcessor::GrabData(const QDateTime pstartDate, QString postFilename = GetPostFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabData: Creating temp post file"); + LOG(VB_GENERAL, LOG_ERR, "GrabData: Creating temp post file"); return false; } if (!DDPost(ddurl, postFilename, inputfile, GetUserID(), GetPassword(), pstartDate, pendDate, err)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Failed to get data: %1") + LOG(VB_GENERAL, LOG_ERR, QString("Failed to get data: %1") .arg(err)); return false; } @@ -1210,7 +1227,7 @@ bool DataDirectProcessor::GrabData(const QDateTime pstartDate, if (data.isEmpty()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Data is empty"); + LOG(VB_GENERAL, LOG_ERR, "Data is empty"); return false; } @@ -1224,9 +1241,9 @@ bool DataDirectProcessor::GrabData(const QDateTime pstartDate, xmlsimplereader.setContentHandler(&ddhandler); if (!xmlsimplereader.parse(xmlsource)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "DataDirect XML failed to " - "properly parse, downloaded listings were probably " - "corrupt."); + LOG(VB_GENERAL, LOG_ERR, + "DataDirect XML failed to properly parse, downloaded listings " + "were probably corrupt."); ok = false; } @@ -1348,7 +1365,7 @@ void DataDirectProcessor::CreateTempTables() bool DataDirectProcessor::GrabLoginCookiesAndLineups(bool parse_lineups) { - VERBOSE(VB_GENERAL, "Grabbing login cookies and lineups"); + LOG(VB_GENERAL, LOG_INFO, "Grabbing login cookies and lineups"); PostList list; list.push_back(PostItem("username", GetUserID())); @@ -1362,14 +1379,14 @@ bool DataDirectProcessor::GrabLoginCookiesAndLineups(bool parse_lineups) QString resultFilename = GetResultFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabLoginCookiesAndLineups: " + LOG(VB_GENERAL, LOG_ERR, "GrabLoginCookiesAndLineups: " "Creating temp result file"); return false; } QString cookieFilename = GetCookieFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabLoginCookiesAndLineups: " + LOG(VB_GENERAL, LOG_ERR, "GrabLoginCookiesAndLineups: " "Creating temp cookie file"); return false; } @@ -1388,7 +1405,7 @@ bool DataDirectProcessor::GrabLoginCookiesAndLineups(bool parse_lineups) bool DataDirectProcessor::GrabLineupForModify(const QString &lineupid) { - VERBOSE(VB_GENERAL, QString("Grabbing lineup %1 for modification") + LOG(VB_GENERAL, LOG_INFO, QString("Grabbing lineup %1 for modification") .arg(lineupid)); RawLineupMap::const_iterator it = rawlineups.find(lineupid); @@ -1405,14 +1422,14 @@ bool DataDirectProcessor::GrabLineupForModify(const QString &lineupid) QString resultFilename = GetResultFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabLoginCookiesAndLineups: " + LOG(VB_GENERAL, LOG_ERR, "GrabLoginCookiesAndLineups: " "Creating temp result file"); return false; } QString cookieFilename = GetCookieFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabLoginCookiesAndLineups: " + LOG(VB_GENERAL, LOG_ERR, "GrabLoginCookiesAndLineups: " "Creating temp cookie file"); return false; } @@ -1426,7 +1443,7 @@ bool DataDirectProcessor::GrabLineupForModify(const QString &lineupid) void DataDirectProcessor::SetAll(const QString &lineupid, bool val) { - VERBOSE(VB_GENERAL, QString("%1 all channels in lineup %2") + LOG(VB_GENERAL, LOG_INFO, QString("%1 all channels in lineup %2") .arg((val) ? "Selecting" : "Deselecting").arg(lineupid)); RawLineupMap::iterator lit = rawlineups.find(lineupid); @@ -1449,22 +1466,22 @@ QDateTime DataDirectProcessor::GetLineupCacheAge(const QString &lineupid) const QFile lfile(get_cache_filename(lineupid)); if (!lfile.exists()) { - VERBOSE(VB_GENERAL, "GrabLineupCacheAge("+lineupid+") failed -- " + - QString("file '%1' doesn't exist") + LOG(VB_GENERAL, LOG_ERR, "GrabLineupCacheAge("+lineupid+") failed -- " + + QString("file '%1' doesn't exist") .arg(get_cache_filename(lineupid))); return cache_dt; } if (lfile.size() < 8) { - VERBOSE(VB_IMPORTANT, "GrabLineupCacheAge("+lineupid+") failed -- " + - QString("file '%1' size %2 too small") + LOG(VB_GENERAL, LOG_ERR, "GrabLineupCacheAge("+lineupid+") failed -- " + + QString("file '%1' size %2 too small") .arg(get_cache_filename(lineupid)).arg(lfile.size())); return cache_dt; } if (!lfile.open(QIODevice::ReadOnly)) { - VERBOSE(VB_IMPORTANT, "GrabLineupCacheAge("+lineupid+") failed -- " + - QString("cannot open file '%1'") + LOG(VB_GENERAL, LOG_ERR, "GrabLineupCacheAge("+lineupid+") failed -- " + + QString("cannot open file '%1'") .arg(get_cache_filename(lineupid))); return cache_dt; } @@ -1474,7 +1491,7 @@ QDateTime DataDirectProcessor::GetLineupCacheAge(const QString &lineupid) const io >> tmp; cache_dt = QDateTime::fromString(tmp, Qt::ISODate); - VERBOSE(VB_GENERAL, "GrabLineupCacheAge("+lineupid+") -> " + + LOG(VB_GENERAL, LOG_INFO, "GrabLineupCacheAge("+lineupid+") -> " + cache_dt.toString(Qt::ISODate)); return cache_dt; @@ -1483,9 +1500,10 @@ QDateTime DataDirectProcessor::GetLineupCacheAge(const QString &lineupid) const bool DataDirectProcessor::GrabLineupsFromCache(const QString &lineupid) { QFile lfile(get_cache_filename(lineupid)); - if (!lfile.exists() || (lfile.size() < 8) || !lfile.open(QIODevice::ReadOnly)) + if (!lfile.exists() || (lfile.size() < 8) || + !lfile.open(QIODevice::ReadOnly)) { - VERBOSE(VB_IMPORTANT, "GrabLineupFromCache("+lineupid+") -- failed"); + LOG(VB_GENERAL, LOG_ERR, "GrabLineupFromCache("+lineupid+") -- failed"); return false; } @@ -1534,7 +1552,7 @@ bool DataDirectProcessor::GrabLineupsFromCache(const QString &lineupid) stations[station.stationid] = station; } - VERBOSE(VB_GENERAL, "GrabLineupFromCache("+lineupid+") -- success"); + LOG(VB_GENERAL, LOG_INFO, "GrabLineupFromCache("+lineupid+") -- success"); return true; } @@ -1546,7 +1564,7 @@ bool DataDirectProcessor::SaveLineupToCache(const QString &lineupid) const QFile lfile(fna.constData()); if (!lfile.open(QIODevice::WriteOnly)) { - VERBOSE(VB_IMPORTANT, "SaveLineupToCache("+lineupid+") -- failed"); + LOG(VB_GENERAL, LOG_ERR, "SaveLineupToCache("+lineupid+") -- failed"); return false; } @@ -1589,7 +1607,7 @@ bool DataDirectProcessor::SaveLineupToCache(const QString &lineupid) const } io << flush; - VERBOSE(VB_GENERAL, "SaveLineupToCache("+lineupid+") -- success"); + LOG(VB_GENERAL, LOG_INFO, "SaveLineupToCache("+lineupid+") -- success"); makeFileAccessible(fna.constData()); // Let anybody update it @@ -1698,14 +1716,14 @@ bool DataDirectProcessor::SaveLineupChanges(const QString &lineupid) } list.push_back(PostItem("action", "Update")); - VERBOSE(VB_GENERAL, QString("Saving lineup %1 with %2 channels") + LOG(VB_GENERAL, LOG_INFO, QString("Saving lineup %1 with %2 channels") .arg(lineupid).arg(list.size() - 1)); bool ok; QString cookieFilename = GetCookieFilename(ok); if (!ok) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "GrabLoginCookiesAndLineups: " + LOG(VB_GENERAL, LOG_ERR, "GrabLoginCookiesAndLineups: " "Creating temp cookie file"); return false; } @@ -1741,11 +1759,11 @@ bool DataDirectProcessor::UpdateListings(uint sourceid) xmltvids[query.value(0).toString()] = true; } - VERBOSE(VB_GENERAL, "Saving updated DataDirect listing"); + LOG(VB_GENERAL, LOG_INFO, "Saving updated DataDirect listing"); bool ok = SaveLineup(lineupid, xmltvids); if (!ok) - VERBOSE(VB_GENERAL, "Failed to update DataDirect listings."); + LOG(VB_GENERAL, LOG_ERR, "Failed to update DataDirect listings."); return ok; } @@ -1918,7 +1936,7 @@ bool DataDirectProcessor::Post(QString url, const PostList &list, #endif if (SHOW_WGET_OUTPUT) - VERBOSE(VB_GENERAL, "command: " + command); + LOG(VB_GENERAL, LOG_DEBUG, "command: " + command); else { command += (documentFile.isEmpty()) ? "&> " : "2> "; @@ -1939,8 +1957,8 @@ bool DataDirectProcessor::ParseLineups(const QString &documentFile) QFile file(documentFile); if (!file.open(QIODevice::ReadOnly)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Failed to open '%1'").arg(documentFile)); + LOG(VB_GENERAL, LOG_ERR, QString("Failed to open '%1'") + .arg(documentFile)); return false; } @@ -1961,7 +1979,9 @@ bool DataDirectProcessor::ParseLineups(const QString &documentFile) in_form = true; get_action = get_setting(line.mid(frm + 5), "action"); name_value.clear(); - //VERBOSE(VB_GENERAL, QString("action: %1").arg(action)); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, QString("action: %1").arg(action)); +#endif } if (!in_form) @@ -1971,11 +1991,15 @@ bool DataDirectProcessor::ParseLineups(const QString &documentFile) if (inp >= 0) { QString input_line = line.mid(inp + 6); - //VERBOSE(VB_GENERAL, QString("input: %1").arg(input_line)); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, QString("input: %1").arg(input_line)); +#endif QString name = get_setting(input_line, "name"); QString value = get_setting(input_line, "value"); - //VERBOSE(VB_GENERAL, QString("name: %1").arg(name)); - //VERBOSE(VB_GENERAL, QString("value: %1").arg(value)); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, QString("name: %1").arg(name)); + LOG(VB_GENERAL, LOG_DEBUG, QString("value: %1").arg(value)); +#endif if (!name.isEmpty() && !value.isEmpty()) name_value[name] = value; } @@ -1993,8 +2017,7 @@ bool DataDirectProcessor::ParseLineups(const QString &documentFile) rawlineups[name_value["lineup_id"]] = item; #if 0 - VERBOSE(VB_IMPORTANT, LOC + - QString("<%1> \t--> <%2,%3,%4>") + LOG(VB_GENERAL, LOG_DEBUG, QString("<%1> \t--> <%2,%3,%4>") .arg(name_value["lineup_id"]) .arg(item.udl_id).arg(item.zipcode) .arg(item.get_action)); @@ -2011,8 +2034,8 @@ bool DataDirectProcessor::ParseLineup(const QString &lineupid, QFile file(documentFile); if (!file.open(QIODevice::ReadOnly)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Failed to open '%1'").arg(documentFile)); + LOG(VB_GENERAL, LOG_ERR, QString("Failed to open '%1'") + .arg(documentFile)); return false; } @@ -2034,7 +2057,9 @@ bool DataDirectProcessor::ParseLineup(const QString &lineupid, { in_form = true; lineup.set_action = get_setting(line.mid(frm + 5), "action"); - //VERBOSE(VB_GENERAL "set_action: " + lineup.set_action); +#if 0 + LOG(VB_GENERAL, LOG_DEBUG, "set_action: " + lineup.set_action); +#endif } if (!in_form) @@ -2091,7 +2116,7 @@ bool DataDirectProcessor::ParseLineup(const QString &lineupid, settings["lbl_ch"], settings["lbl_callsign"]); #if 0 - VERBOSE(VB_IMPORTANT, LOC + + LOG(VB_GENERAL, LOG_DEBUG, QString("name: %1 id: %2 value: %3 " "checked: %4 ch: %5 call: %6") .arg(settings["chk_name"]).arg(settings["chk_id"]) @@ -2265,7 +2290,7 @@ static uint update_channel_basic(uint sourceid, bool insert, chan_update_q.bindValue(":SOURCEID", sourceid); #if 0 - VERBOSE(VB_GENERAL, LOC + + LOG(VB_GENERAL, LOG_INFO, QString("Updating channel %1: '%2' (%3).") .arg(chanid).arg(name).arg(callsign)); #endif @@ -2298,7 +2323,7 @@ static uint update_channel_basic(uint sourceid, bool insert, if ((mplexid > 0) || (minorC == 0)) chanid = ChannelUtil::CreateChanID(sourceid, channum); - VERBOSE(VB_GENERAL, LOC + QString("Adding channel %1 '%2' (%3).") + LOG(VB_GENERAL, LOG_INFO, QString("Adding channel %1 '%2' (%3).") .arg(channum).arg(name).arg(callsign)); if (chanid > 0) @@ -2353,7 +2378,8 @@ static void set_lineup_type(const QString &lineupid, const QString &type) tmptype.detach(); srcid_to_type[srcid] = tmptype; - VERBOSE(VB_GENERAL, QString("sourceid %1 has lineup type: %2").arg(srcid).arg(type)); + LOG(VB_GENERAL, LOG_INFO, QString("sourceid %1 has lineup type: %2") + .arg(srcid).arg(type)); } } diff --git a/mythtv/libs/libmythtv/dbchannelinfo.cpp b/mythtv/libs/libmythtv/dbchannelinfo.cpp index a22d8028af1..e127099f9ab 100644 --- a/mythtv/libs/libmythtv/dbchannelinfo.cpp +++ b/mythtv/libs/libmythtv/dbchannelinfo.cpp @@ -91,8 +91,9 @@ bool PixmapChannel::CacheChannelIcon(void) if (!localDir.exists() && !localDir.mkdir(localDirStr)) { - VERBOSE(VB_IMPORTANT, QString("Icons directory is missing and could " - "not be created: %1").arg(localDirStr)); + LOG(VB_GENERAL, LOG_ERR, + QString("Icons directory is missing and could not be created: %1") + .arg(localDirStr)); icon.clear(); return false; } @@ -137,11 +138,13 @@ bool PixmapChannel::CacheChannelIcon(void) if (image.save(m_localIcon)) { - VERBOSE(VB_GENERAL, QString("Caching channel icon %1").arg(m_localIcon)); + LOG(VB_GENERAL, LOG_INFO, + QString("Caching channel icon %1").arg(m_localIcon)); return true; } else - VERBOSE(VB_GENERAL, QString("Failed to save to %1").arg(m_localIcon)); + LOG(VB_GENERAL, LOG_ERR, + QString("Failed to save to %1").arg(m_localIcon)); } // if we get here then the icon is set in the db but couldn't be found diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp index ebdc01feb5d..64de6de020c 100644 --- a/mythtv/libs/libmythtv/dbcheck.cpp +++ b/mythtv/libs/libmythtv/dbcheck.cpp @@ -366,7 +366,7 @@ static bool UpdateDBVersionNumber(const QString &newnumber, QString &dbver) .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg(newnumber); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -383,7 +383,7 @@ static bool UpdateDBVersionNumber(const QString &newnumber, QString &dbver) .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg(newnumber); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -406,7 +406,7 @@ static bool performActualUpdate( { MSqlQuery query(MSqlQuery::InitCon()); - VERBOSE(VB_IMPORTANT, QString("Upgrading to MythTV schema version ") + + LOG(VB_GENERAL, LOG_CRIT, QString("Upgrading to MythTV schema version ") + version); int counter = 0; @@ -422,7 +422,7 @@ static bool performActualUpdate( .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg(version); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -477,7 +477,7 @@ bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, } if (!upgradeAllowed) - VERBOSE(VB_IMPORTANT, "Not allowed to upgrade the database."); + LOG(VB_GENERAL, LOG_ERR, "Not allowed to upgrade the database."); // Pop up messages, questions, warnings, etc. switch (DBup->PromptForUpgrade("TV", upgradeAllowed, @@ -502,7 +502,7 @@ bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, MythDB::DBError("UpgradeTVDatabaseSchema -- alter charset", query); - VERBOSE(VB_IMPORTANT, "Newest MythTV Schema Version : "+ + LOG(VB_GENERAL, LOG_CRIT, "Newest MythTV Schema Version : "+ currentDatabaseVersion); if (!DBUtil::lockSchema(query)) @@ -514,9 +514,10 @@ bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, bool ret = doUpgradeTVDatabaseSchema(); if (ret) - VERBOSE(VB_IMPORTANT, "Database Schema upgrade complete, unlocking."); + LOG(VB_GENERAL, LOG_NOTICE, + "Database Schema upgrade complete, unlocking."); else - VERBOSE(VB_IMPORTANT, "Database Schema upgrade FAILED, unlocking."); + LOG(VB_GENERAL, LOG_ERR, "Database Schema upgrade FAILED, unlocking."); DBUtil::unlockSchema(query); gCoreContext->ActivateSettingsCache(true); @@ -556,8 +557,8 @@ static bool doUpgradeTVDatabaseSchema(void) if (dbver.isEmpty() || dbver.toInt() < 1027) { - VERBOSE(VB_IMPORTANT, "Unrecognized database schema version. " - "Unable to upgrade database."); + LOG(VB_GENERAL, LOG_ERR, "Unrecognized database schema version. " + "Unable to upgrade database."); return false; } @@ -1684,7 +1685,7 @@ NULL if (dbver == "1093") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1094"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1094"); MSqlQuery recordids(MSqlQuery::InitCon()); recordids.prepare("SELECT recordid,recpriority FROM record;"); @@ -2778,7 +2779,7 @@ NULL .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg("1170"); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -2899,7 +2900,7 @@ NULL .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg("1176"); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -3008,7 +3009,7 @@ NULL if (dbver == "1181") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1182"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1182"); MSqlQuery airdates(MSqlQuery::InitCon()); airdates.prepare("SELECT chanid, starttime FROM recordedprogram " @@ -3075,7 +3076,7 @@ NULL if (dbver == "1185") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1186"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1186"); MSqlQuery ppuq(MSqlQuery::InitCon()); @@ -3289,7 +3290,7 @@ NULL .arg(thequery) .arg(MythDB::DBErrorMessage(query.lastError())) .arg("1198"); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } @@ -3685,8 +3686,9 @@ NULL "Unable to proceed with database " "upgrade. (Table: %1, Warnings: %2)") .arg(table).arg(warnings); - VERBOSE(VB_IMPORTANT, msg); - VERBOSE(VB_IMPORTANT, "Your database must be fixed before " + LOG(VB_GENERAL, LOG_WARNING, msg); + LOG(VB_GENERAL, LOG_WARNING, + "Your database must be fixed before " "you can upgrade beyond 0.21-fixes. Please see " "http://www.mythtv.org/wiki/" "Fixing_Corrupt_Database_Encoding for information " @@ -3713,7 +3715,7 @@ NULL { MythDB::DBError(QString("Index creation failed."), thequery); - VERBOSE(VB_IMPORTANT, "DB charset pre-conversion test " + LOG(VB_GENERAL, LOG_ERR, "DB charset pre-conversion test " "failed! Your database seems to be partially " "corrupted. Please move the backup to a safe " "place. Your database must be fixed before you " @@ -3969,7 +3971,7 @@ NULL if (!performActualUpdate(updates, "1216", dbver)) { - VERBOSE(VB_IMPORTANT, "DB charset conversions update failed! " + LOG(VB_GENERAL, LOG_ERR, "DB charset conversions update failed! " "Your database seems to be partially corrupted. Please " "move the backup to a safe place. Your database must be " "fixed before you can upgrade beyond 0.21-fixes. Please " @@ -4279,7 +4281,7 @@ NULL if (!performActualUpdate(updates, "1217", dbver)) { - VERBOSE(VB_IMPORTANT, "DB charset conversions update failed! " + LOG(VB_GENERAL, LOG_ERR, "DB charset conversions update failed! " "Your database seems to be partially corrupted. Please " "move the backup to a safe place. Your database must be " "fixed before you can upgrade beyond 0.21-fixes. Please " @@ -4964,7 +4966,7 @@ NULL if (dbver == "1249") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1250"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1250"); MSqlQuery select(MSqlQuery::InitCon()); select.prepare("SELECT hostname, data FROM settings " @@ -5059,7 +5061,7 @@ NULL if (dbver == "1251") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1252"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1252"); MSqlQuery query(MSqlQuery::InitCon()); query.prepare("SHOW INDEX FROM recgrouppassword"); @@ -5096,7 +5098,7 @@ NULL if (dbver == "1252") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1253"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1253"); MSqlQuery select(MSqlQuery::InitCon()); select.prepare("SELECT hostname, data FROM settings " @@ -5160,7 +5162,8 @@ NULL if (gCoreContext->GetNumSetting("have-nit-fix") == 1) { // User has previously applied patch from ticket #7486. - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1254"); + LOG(VB_GENERAL, LOG_NOTICE, + "Upgrading to MythTV schema version 1254"); if (!UpdateDBVersionNumber("1254", dbver)) return false; } @@ -5263,7 +5266,7 @@ NULL if (dbver == "1258") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1259"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1259"); MSqlQuery select(MSqlQuery::InitCon()); select.prepare("SELECT hostname, data FROM settings " @@ -5347,7 +5350,7 @@ NULL if (dbver == "1259") { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1260"); + LOG(VB_GENERAL, LOG_NOTICE, "Upgrading to MythTV schema version 1260"); MSqlQuery query(MSqlQuery::InitCon()); query.prepare("DELETE FROM keybindings WHERE " @@ -5438,7 +5441,8 @@ NULL { if (gCoreContext->GetNumSetting("MythFillFixProgramIDsHasRunOnce", 0)) { - VERBOSE(VB_IMPORTANT, "Upgrading to MythTV schema version 1261"); + LOG(VB_GENERAL, LOG_NOTICE, + "Upgrading to MythTV schema version 1261"); if (!UpdateDBVersionNumber("1261", dbver)) return false; } @@ -5810,11 +5814,12 @@ bool InitializeMythSchema(void) "If you are sure this is a good MythTV database, verify\n" "that the settings table has the DBSchemaVer variable.\n") .arg(query.size() - 1); - VERBOSE(VB_IMPORTANT, msg); + LOG(VB_GENERAL, LOG_ERR, msg); return false; } - VERBOSE(VB_IMPORTANT, "Inserting MythTV initial database information."); + LOG(VB_GENERAL, LOG_NOTICE, + "Inserting MythTV initial database information."); QString qtmp = QString("ALTER DATABASE %1 DEFAULT CHARACTER SET utf8;") .arg(gCoreContext->GetDatabaseParams().dbName); diff --git a/mythtv/libs/libmythtv/decoderbase.cpp b/mythtv/libs/libmythtv/decoderbase.cpp index cec841f7977..be4cdca7f25 100644 --- a/mythtv/libs/libmythtv/decoderbase.cpp +++ b/mythtv/libs/libmythtv/decoderbase.cpp @@ -69,7 +69,7 @@ void DecoderBase::SetProgramInfo(const ProgramInfo &pginfo) void DecoderBase::Reset(bool reset_video_data, bool seek_reset, bool reset_file) { - VERBOSE(VB_PLAYBACK, LOC + QString("Reset: Video %1, Seek %2, File %3") + LOG(VB_PLAYBACK, LOG_INFO, QString("Reset: Video %1, Seek %2, File %3") .arg(reset_video_data).arg(seek_reset).arg(reset_file)); if (seek_reset) @@ -138,8 +138,13 @@ bool DecoderBase::PosMapFromDb(void) keyframedist = 12; totframes = (long long)(ringBuffer->BD()->GetTotalTimeOfTitle() * fps); posMap[totframes] = ringBuffer->BD()->GetTotalReadPosition(); -// VERBOSE(VB_PLAYBACK, QString("%1 TotalTimeOfTitle() in ticks, %2 TotalReadPosition() in bytes, %3 is fps") -// .arg(ringBuffer->BD()->GetTotalTimeOfTitle()).arg(ringBuffer->BD()->GetTotalReadPosition()).arg(fps)); +#if 0 + LOG(VB_PLAYBACK, LOG_DEBUG, + QString("%1 TotalTimeOfTitle() in ticks, %2 TotalReadPosition() " + "in bytes, %3 is fps") + .arg(ringBuffer->BD()->GetTotalTimeOfTitle()) + .arg(ringBuffer->BD()->GetTotalReadPosition()).arg(fps)); +#endif } else if ((positionMapType == MARK_UNSET) || (keyframedist == -1)) @@ -200,7 +205,7 @@ bool DecoderBase::PosMapFromDb(void) if (!m_positionMap.empty()) { - VERBOSE(VB_PLAYBACK, LOC + QString("Position map filled from DB to: %1") + LOG(VB_PLAYBACK, LOG_INFO, QString("Position map filled from DB to: %1") .arg(m_positionMap.back().index)); } @@ -251,8 +256,8 @@ bool DecoderBase::PosMapFromEnc(void) if (!m_positionMap.empty()) { - VERBOSE(VB_PLAYBACK, LOC + - QString("Position map filled from Encoder to: %1") + LOG(VB_PLAYBACK, LOG_INFO, + QString("Position map filled from Encoder to: %1") .arg(m_positionMap.back().index)); } @@ -289,8 +294,9 @@ unsigned long DecoderBase::GetPositionMapSize(void) const */ bool DecoderBase::SyncPositionMap(void) { - VERBOSE(VB_PLAYBACK, LOC + QString("Resyncing position map. posmapStarted = %1" - " livetv(%2) watchingRec(%3)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("Resyncing position map. posmapStarted = %1" + " livetv(%2) watchingRec(%3)") .arg((int) posmapStarted).arg(livetv).arg(watchingrecording)); if (dontSyncPositionMap) @@ -306,23 +312,22 @@ bool DecoderBase::SyncPositionMap(void) // starting up -- try first from database PosMapFromDb(); new_posmap_size = GetPositionMapSize(); - VERBOSE(VB_PLAYBACK, LOC + - QString("SyncPositionMap watchingrecording, from DB: " - "%1 entries") - .arg(new_posmap_size)); + LOG(VB_PLAYBACK, LOG_INFO, + QString("SyncPositionMap watchingrecording, from DB: " + "%1 entries") .arg(new_posmap_size)); } // always try to get more from encoder if (!PosMapFromEnc()) { - VERBOSE(VB_PLAYBACK, LOC + - QString("SyncPositionMap watchingrecording no entries " - "from encoder, try DB")); + LOG(VB_PLAYBACK, LOG_INFO, + QString("SyncPositionMap watchingrecording no entries " + "from encoder, try DB")); PosMapFromDb(); // try again from db } new_posmap_size = GetPositionMapSize(); - VERBOSE(VB_PLAYBACK, LOC + - QString("SyncPositionMap watchingrecording total: %1 entries") + LOG(VB_PLAYBACK, LOG_INFO, + QString("SyncPositionMap watchingrecording total: %1 entries") .arg(new_posmap_size)); } else @@ -333,8 +338,8 @@ bool DecoderBase::SyncPositionMap(void) PosMapFromDb(); new_posmap_size = GetPositionMapSize(); - VERBOSE(VB_PLAYBACK, LOC + - QString("SyncPositionMap prerecorded, from DB: %1 entries") + LOG(VB_PLAYBACK, LOG_INFO, + QString("SyncPositionMap prerecorded, from DB: %1 entries") .arg(new_posmap_size)); } } @@ -370,9 +375,9 @@ bool DecoderBase::SyncPositionMap(void) m_parent->SetKeyframeDistance(keyframedist); posmapStarted = true; - VERBOSE(VB_PLAYBACK, LOC + - QString("SyncPositionMap, new totframes: %1, new length: %2, " - "posMap size: %3") + LOG(VB_PLAYBACK, LOG_INFO, + QString("SyncPositionMap, new totframes: %1, new length: %2, " + "posMap size: %3") .arg(totframes).arg(length).arg(new_posmap_size)); } recordingHasPositionMap |= (0 != new_posmap_size); @@ -407,10 +412,10 @@ bool DecoderBase::FindPosition(long long desired_value, bool search_adjusted, upper_bound = i; lower_bound = i; - VERBOSE(VB_PLAYBACK, LOC + - QString("FindPosition(%1, search%2 adjusted)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("FindPosition(%1, search%2 adjusted)") .arg(desired_value).arg((search_adjusted) ? "" : " not") + - QString(" --> [%1:%2(%3)]") + QString(" --> [%1:%2(%3)]") .arg(i).arg(GetKey(m_positionMap[i])) .arg(m_positionMap[i].pos)); @@ -446,10 +451,10 @@ bool DecoderBase::FindPosition(long long desired_value, bool search_adjusted, upper_bound = upper; lower_bound = lower; - VERBOSE(VB_PLAYBACK, LOC + - QString("FindPosition(%1, search%3 adjusted)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("FindPosition(%1, search%3 adjusted)") .arg(desired_value).arg((search_adjusted) ? "" : " not") + - QString(" --> \n\t\t\t[%1:%2(%3),%4:%5(%6)]") + QString(" --> \n\t\t\t[%1:%2(%3),%4:%5(%6)]") .arg(lower_bound).arg(GetKey(m_positionMap[lower_bound])) .arg(m_positionMap[lower_bound].pos) .arg(upper_bound).arg(GetKey(m_positionMap[upper_bound])) @@ -489,9 +494,9 @@ uint64_t DecoderBase::SavePositionMapDelta(uint64_t first, uint64_t last) m_playbackinfo->SavePositionMapDelta(posMap, type); #if 0 - VERBOSE(VB_IMPORTANT, LOC + - QString("Saving position map [%1,%2] w/%3 keyframes, " - "took (%4,%5,%6) ms\n") + LOG(VB_GENERAL, LOG_DEBUG, + QString("Saving position map [%1,%2] w/%3 keyframes, " + "took (%4,%5,%6) ms") .arg(first).arg(last).arg(saved) .arg(ttm.elapsed()) .arg(ctm.elapsed()-stm.elapsed()).arg(stm.elapsed())); @@ -502,8 +507,8 @@ uint64_t DecoderBase::SavePositionMapDelta(uint64_t first, uint64_t last) bool DecoderBase::DoRewind(long long desiredFrame, bool discardFrames) { - VERBOSE(VB_PLAYBACK, LOC + - QString("DoRewind(%1 (%2), %3 discard frames)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("DoRewind(%1 (%2), %3 discard frames)") .arg(desiredFrame).arg(framesPlayed) .arg((discardFrames) ? "do" : "don't")); @@ -552,7 +557,7 @@ bool DecoderBase::DoRewindSeek(long long desiredFrame) if (!GetPositionMapSize()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "PosMap is empty, can't seek"); + LOG(VB_GENERAL, LOG_ERR, "PosMap is empty, can't seek"); return false; } @@ -614,9 +619,9 @@ long long DecoderBase::ConditionallyUpdatePosMap(long long desiredFrame) if (desiredFrame < last_frame) return last_frame; - VERBOSE(VB_PLAYBACK, LOC + "ConditionallyUpdatePosMap: " - "Not enough info in positionMap," + - QString("\n\t\t\twe need frame %1 but highest we have is %2.") + LOG(VB_PLAYBACK, LOG_INFO, + "ConditionallyUpdatePosMap: Not enough info in positionMap," + + QString("\n\t\t\twe need frame %1 but highest we have is %2.") .arg(desiredFrame).arg(last_frame)); SyncPositionMap(); @@ -625,10 +630,10 @@ long long DecoderBase::ConditionallyUpdatePosMap(long long desiredFrame) if (desiredFrame > last_frame) { - VERBOSE(VB_PLAYBACK, LOC + "ConditionallyUpdatePosMap: " - "Still not enough info in positionMap after sync, " + - QString("\n\t\t\twe need frame %1 but highest we have " - "is %2. Will attempt to seek frame-by-frame") + LOG(VB_PLAYBACK, LOG_INFO, "ConditionallyUpdatePosMap: Still not " + "enough info in positionMap after sync, " + + QString("\n\t\t\twe need frame %1 but highest we have " + "is %2. Will attempt to seek frame-by-frame") .arg(desiredFrame).arg(last_frame)); } @@ -646,8 +651,8 @@ long long DecoderBase::ConditionallyUpdatePosMap(long long desiredFrame) */ bool DecoderBase::DoFastForward(long long desiredFrame, bool discardFrames) { - VERBOSE(VB_PLAYBACK, LOC + - QString("DoFastForward(%1 (%2), %3 discard frames)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("DoFastForward(%1 (%2), %3 discard frames)") .arg(desiredFrame).arg(framesPlayed) .arg((discardFrames) ? "do" : "don't")); @@ -680,13 +685,13 @@ bool DecoderBase::DoFastForward(long long desiredFrame, bool discardFrames) bool needflush = false; if (desiredFrame > last_frame) { - VERBOSE(VB_IMPORTANT, LOC + - QString("DoFastForward(): desiredFrame(%1) > last_frame(%2)") + LOG(VB_GENERAL, LOG_NOTICE, + QString("DoFastForward(): desiredFrame(%1) > last_frame(%2)") .arg(desiredFrame).arg(last_frame)); if (desiredFrame - last_frame > 32) { - VERBOSE(VB_IMPORTANT, LOC + "DoFastForward(): " + LOG(VB_GENERAL, LOG_ERR, "DoFastForward(): " "Desired frame is way past the end of the keyframe map!" "\n\t\t\tSeeking to last keyframe instead."); desiredFrame = last_frame; @@ -1039,7 +1044,7 @@ int DecoderBase::AutoSelectTrack(uint type) if ((selTrack < 0) && wantedTrack[type].language>=-1 && numStreams) { - VERBOSE(VB_PLAYBACK, LOC + "Trying to reselect track"); + LOG(VB_PLAYBACK, LOG_INFO, "Trying to reselect track"); // Try to reselect user selected track stream. // This should find the stream after a commercial // break and in some cases after a channel change. @@ -1056,7 +1061,7 @@ int DecoderBase::AutoSelectTrack(uint type) if (selTrack < 0 && numStreams) { - VERBOSE(VB_PLAYBACK, LOC + "Trying to select track (w/lang)"); + LOG(VB_PLAYBACK, LOG_INFO, "Trying to select track (w/lang)"); // Find first track stream that matches a language in // order of most preferred to least preferred language. vector::iterator it = languagePreference.begin(); @@ -1075,7 +1080,7 @@ int DecoderBase::AutoSelectTrack(uint type) if (selTrack < 0 && numStreams) { - VERBOSE(VB_PLAYBACK, LOC + "Selecting first track"); + LOG(VB_PLAYBACK, LOG_INFO, "Selecting first track"); selTrack = 0; } @@ -1088,8 +1093,8 @@ int DecoderBase::AutoSelectTrack(uint type) wantedTrack[type] = tmp; int lang = tracks[type][currentTrack[type]].language; - VERBOSE(VB_PLAYBACK, LOC + - QString("Selected track #%1 in the %2 language(%3)") + LOG(VB_PLAYBACK, LOG_INFO, + QString("Selected track #%1 in the %2 language(%3)") .arg(currentTrack[type]+1) .arg(iso639_key_toName(lang)).arg(lang)); diff --git a/mythtv/libs/libmythtv/deletemap.cpp b/mythtv/libs/libmythtv/deletemap.cpp index 1047d2e6b34..e691c1711bd 100644 --- a/mythtv/libs/libmythtv/deletemap.cpp +++ b/mythtv/libs/libmythtv/deletemap.cpp @@ -9,7 +9,7 @@ #define LOC QString("DelMap: ") #define LOC_ERR QString("DelMap Err: ") #define EDIT_CHECK if(!m_editing) \ - { VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot edit outside edit mode."); return; } + { LOG(VB_GENERAL, LOG_ERR, "Cannot edit outside edit mode."); return; } DeleteMapUndoEntry::DeleteMapUndoEntry(frm_dir_map_t dm, QString msg) : deleteMap(dm), message(msg) { } @@ -408,7 +408,7 @@ void DeleteMap::NewCut(uint64_t frame, uint64_t total) // Don't cut the entire recording if ((startframe == 0) && (endframe == total)) { - VERBOSE(VB_IMPORTANT, "Refusing to cut entire recording."); + LOG(VB_GENERAL, LOG_CRIT, "Refusing to cut entire recording."); return; } @@ -423,8 +423,8 @@ void DeleteMap::NewCut(uint64_t frame, uint64_t total) otherframe = it.key(); if ((startframe < otherframe) && (endframe > otherframe)) { - VERBOSE(VB_PLAYBACK, QString("Deleting bounded marker: %1") - .arg(otherframe)); + LOG(VB_PLAYBACK, LOG_INFO, + QString("Deleting bounded marker: %1").arg(otherframe)); Delete(otherframe); } } @@ -753,8 +753,8 @@ void DeleteMap::TrackerReset(uint64_t frame, uint64_t total) } else m_nextCutStart = GetNearestMark(frame, total, !IsInDelete(frame)); - VERBOSE(VB_PLAYBACK, LOC + QString("Tracker next CUT_START: %1") - .arg(m_nextCutStart)); + LOG(VB_PLAYBACK, LOG_INFO, QString("Tracker next CUT_START: %1") + .arg(m_nextCutStart)); } /** @@ -767,7 +767,7 @@ bool DeleteMap::TrackerWantsToJump(uint64_t frame, uint64_t total, uint64_t &to) return false; to = GetNearestMark(m_nextCutStart, total, true); - VERBOSE(VB_PLAYBACK, LOC + QString("Tracker wants to jump to: %1").arg(to)); + LOG(VB_PLAYBACK, LOG_INFO, QString("Tracker wants to jump to: %1").arg(to)); return true; } diff --git a/mythtv/libs/libmythtv/diseqc.cpp b/mythtv/libs/libmythtv/diseqc.cpp index 3dff259bb3f..81f9fac40ea 100644 --- a/mythtv/libs/libmythtv/diseqc.cpp +++ b/mythtv/libs/libmythtv/diseqc.cpp @@ -357,8 +357,8 @@ bool DiSEqCDevTree::Load(uint cardid) } else if (query.value(1).toString().toUpper() == "DVB") { - VERBOSE(VB_IMPORTANT, LOC_WARN + - QString("No device tree for cardid %1").arg(cardid)); + LOG(VB_GENERAL, LOG_WARNING, + QString("No device tree for cardid %1").arg(cardid)); } return m_root; @@ -434,7 +434,7 @@ bool DiSEqCDevTree::Store(uint cardid) devid = m_root->GetDeviceID(); else if (m_root) { - VERBOSE(VB_IMPORTANT, "Failed to save DiSEqC tree."); + LOG(VB_GENERAL, LOG_ERR, "Failed to save DiSEqC tree."); return false; } @@ -472,7 +472,7 @@ bool DiSEqCDevTree::SetTone(bool on) #endif // USING_DVB if (!success) - VERBOSE(VB_IMPORTANT, LOC_ERR + "FE_SET_TONE failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "FE_SET_TONE failed" + ENO); return success; } @@ -488,7 +488,7 @@ bool DiSEqCDevTree::Execute(const DiSEqCDevSettings &settings, { if (!m_root) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "No root device tree node!"); + LOG(VB_GENERAL, LOG_ERR, "No root device tree node!"); return false; } @@ -611,8 +611,8 @@ static bool send_diseqc(int fd, const dvb_diseqc_master_cmd &cmd) if (!success) { - VERBOSE(VB_IMPORTANT, - "send_diseqc FE_DISEQC_SEND_MASTER_CMD failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, + "send_diseqc FE_DISEQC_SEND_MASTER_CMD failed" + ENO); } return success; @@ -633,7 +633,7 @@ bool DiSEqCDevTree::SendCommand(uint adr, uint cmd, uint repeats, // check payload validity if (data_len > 3 || (data_len > 0 && !data)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Bad DiSEqC command"); + LOG(VB_GENERAL, LOG_ERR, "Bad DiSEqC command"); return false; } @@ -661,14 +661,14 @@ bool DiSEqCDevTree::SendCommand(uint adr, uint cmd, uint repeats, for (uint byte = 0; byte < mcmd.msg_len; byte++) cmdstr += QString("%1 ").arg(mcmd.msg[byte], 2, 16); - VERBOSE(VB_CHANNEL, LOC + "Sending DiSEqC Command: " + cmdstr); + LOG(VB_CHANNEL, LOG_INFO, "Sending DiSEqC Command: " + cmdstr); // send the command for (uint i = 0; i <= repeats; i++) { if (!send_diseqc(GetFD(), mcmd)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "DiSEqC command failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "DiSEqC command failed" + ENO); return false; } @@ -694,7 +694,7 @@ bool DiSEqCDevTree::ResetDiseqc(bool hard_reset) // tests show that the wait times required can be very long (~1sec) if (hard_reset) { - VERBOSE(VB_CHANNEL, LOC + "Power-cycling DiSEqC Bus"); + LOG(VB_CHANNEL, LOG_INFO, "Power-cycling DiSEqC Bus"); SetVoltage(SEC_VOLTAGE_OFF); usleep(DISEQC_POWER_OFF_WAIT); @@ -707,11 +707,10 @@ bool DiSEqCDevTree::ResetDiseqc(bool hard_reset) usleep(DISEQC_POWER_ON_WAIT); // issue a global reset command - VERBOSE(VB_CHANNEL, LOC + "Resetting DiSEqC Bus"); + LOG(VB_CHANNEL, LOG_INFO, "Resetting DiSEqC Bus"); if (!SendCommand(DISEQC_ADR_ALL, DISEQC_CMD_RESET)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "DiSEqC reset failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "DiSEqC reset failed" + ENO); return false; } @@ -737,7 +736,7 @@ bool DiSEqCDevTree::SetVoltage(uint voltage) int volts = ((voltage == SEC_VOLTAGE_18) ? 18 : ((voltage == SEC_VOLTAGE_13) ? 13 : 0)); - VERBOSE(VB_CHANNEL, LOC + "Changing LNB voltage to " + + LOG(VB_CHANNEL, LOG_INFO, "Changing LNB voltage to " + QString("%1V").arg(volts)); bool success = false; @@ -754,7 +753,7 @@ bool DiSEqCDevTree::SetVoltage(uint voltage) if (!success) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "FE_SET_VOLTAGE failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "FE_SET_VOLTAGE failed" + ENO); return false; } @@ -855,7 +854,7 @@ DiSEqCDevDevice *DiSEqCDevDevice::CreateById(DiSEqCDevTree &tree, uint devid) } else if (!query.next()) { - VERBOSE(VB_IMPORTANT, LOC + "CreateById failed to find dtv dev " + + LOG(VB_GENERAL, LOG_ERR, "CreateById failed to find dtv dev " + QString("%1").arg(devid)); return NULL; @@ -1054,8 +1053,7 @@ bool DiSEqCDevSwitch::Execute(const DiSEqCDevSettings &settings, break; default: success = false; - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Unknown switch type (%1)") + LOG(VB_GENERAL, LOG_ERR, QString("Unknown switch type (%1)") .arg((uint)m_type)); break; } @@ -1063,7 +1061,7 @@ bool DiSEqCDevSwitch::Execute(const DiSEqCDevSettings &settings, // if a child device will be sending a diseqc command, wait 100ms if (m_children[pos]->IsCommandNeeded(settings, tuning)) { - VERBOSE(VB_CHANNEL, LOC + "Waiting for switch"); + LOG(VB_CHANNEL, LOG_INFO, "Waiting for switch"); usleep(DISEQC_LONG_WAIT); } @@ -1209,8 +1207,8 @@ bool DiSEqCDevSwitch::Load(void) DiSEqCDevDevice *child = CreateById(m_tree, child_dev_id); if (child && !SetChild(ordinal, child)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Switch port out of range (%1 > %2)") + LOG(VB_GENERAL, LOG_ERR, + QString("Switch port out of range (%1 > %2)") .arg(ordinal + 1).arg(m_num_ports)); delete child; } @@ -1357,15 +1355,14 @@ bool DiSEqCDevSwitch::ExecuteLegacy(const DiSEqCDevSettings &settings, if (num_ports) pos %= num_ports; - VERBOSE(VB_CHANNEL, LOC + QString("Changing to Legacy switch port %1/%2") + LOG(VB_CHANNEL, LOG_INFO, QString("Changing to Legacy switch port %1/%2") .arg(pos + 1).arg(num_ports)); // send command if (ioctl(m_tree.GetFD(), FE_DISHNETWORK_SEND_LEGACY_CMD, cmds[pos] | horizcmd) == -1) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "FE_DISHNETWORK_SEND_LEGACY_CMD failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "FE_DISHNETWORK_SEND_LEGACY_CMD failed" + ENO); return false; } @@ -1374,7 +1371,7 @@ bool DiSEqCDevSwitch::ExecuteLegacy(const DiSEqCDevSettings &settings, #else // !FE_DISHNETWORK_SEND_LEGACY_CMD - VERBOSE(VB_IMPORTANT, LOC_ERR + "You must compile with a newer " + LOG(VB_GENERAL, LOG_ERR, "You must compile with a newer " "version of the linux headers for DishNet Legacy switch support."); return false; @@ -1399,7 +1396,7 @@ static bool set_tone(int fd, fe_sec_tone_mode tone) if (!success) { - VERBOSE(VB_IMPORTANT, "set_tone failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "set_tone failed" + ENO); } return success; @@ -1424,7 +1421,7 @@ static bool set_voltage(int fd, fe_sec_voltage volt) if (!success) { - VERBOSE(VB_IMPORTANT, "FE_SET_VOLTAGE failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, "FE_SET_VOLTAGE failed" + ENO); } return success; @@ -1449,7 +1446,8 @@ static bool mini_diseqc(int fd, fe_sec_mini_cmd cmd) if (!success) { - VERBOSE(VB_IMPORTANT, "mini_diseqc FE_DISEQC_SEND_BURST failed" + ENO); + LOG(VB_GENERAL, LOG_ERR, + "mini_diseqc FE_DISEQC_SEND_BURST failed" + ENO); } return success; @@ -1460,7 +1458,7 @@ bool DiSEqCDevSwitch::ExecuteTone(const DiSEqCDevSettings &/*settings*/, const DTVMultiplex &/*tuning*/, uint pos) { - VERBOSE(VB_CHANNEL, LOC + "Changing to Tone switch port " + + LOG(VB_CHANNEL, LOG_INFO, "Changing to Tone switch port " + QString("%1/2").arg(pos + 1)); #ifdef USING_DVB @@ -1468,7 +1466,7 @@ bool DiSEqCDevSwitch::ExecuteTone(const DiSEqCDevSettings &/*settings*/, return true; #endif // USING_DVB - VERBOSE(VB_IMPORTANT, LOC_ERR + "Setting Tone Switch failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, "Setting Tone Switch failed." + ENO); return false; } @@ -1478,7 +1476,7 @@ bool DiSEqCDevSwitch::ExecuteVoltage(const DiSEqCDevSettings &settings, (void) settings; (void) tuning; - VERBOSE(VB_CHANNEL, LOC + "Changing to Voltage Switch port " + + LOG(VB_CHANNEL, LOG_INFO, "Changing to Voltage Switch port " + QString("%1/2").arg(pos + 1)); #ifdef USING_DVB @@ -1489,7 +1487,7 @@ bool DiSEqCDevSwitch::ExecuteVoltage(const DiSEqCDevSettings &settings, } #endif // USING_DVB - VERBOSE(VB_IMPORTANT, LOC_ERR + "Setting Voltage Switch failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, "Setting Voltage Switch failed." + ENO); return false; } @@ -1500,7 +1498,7 @@ bool DiSEqCDevSwitch::ExecuteMiniDiSEqC(const DiSEqCDevSettings &settings, (void) settings; (void) tuning; - VERBOSE(VB_CHANNEL, LOC + "Changing to MiniDiSEqC Switch port " + + LOG(VB_CHANNEL, LOG_INFO, "Changing to MiniDiSEqC Switch port " + QString("%1/2").arg(pos + 1)); #ifdef USING_DVB @@ -1508,8 +1506,7 @@ bool DiSEqCDevSwitch::ExecuteMiniDiSEqC(const DiSEqCDevSettings &settings, return true; #endif // USING_DVB - VERBOSE(VB_IMPORTANT, LOC_ERR + - "Setting Mini DiSEqC Switch failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, "Setting Mini DiSEqC Switch failed." + ENO); return false; } @@ -1575,8 +1572,8 @@ bool DiSEqCDevSwitch::ExecuteDiseqc(const DiSEqCDevSettings &settings, if (((kTypeDiSEqCCommitted == m_type) && (m_num_ports > 4)) || ((kTypeDiSEqCUncommitted == m_type) && (m_num_ports > 16))) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Invalid number of ports for DiSEqC 1.x Switch (%1)") + LOG(VB_GENERAL, LOG_ERR, + QString("Invalid number of ports for DiSEqC 1.x Switch (%1)") .arg(m_num_ports)); return false; } @@ -1591,7 +1588,7 @@ bool DiSEqCDevSwitch::ExecuteDiseqc(const DiSEqCDevSettings &settings, } data |= 0xf0; - VERBOSE(VB_CHANNEL, LOC + "Changing to DiSEqC switch port " + + LOG(VB_CHANNEL, LOG_INFO, "Changing to DiSEqC switch port " + QString("%1/%2").arg(pos + 1).arg(m_num_ports)); bool ret = m_tree.SendCommand(m_address, cmd, m_repeat, 1, &data); @@ -1609,7 +1606,7 @@ int DiSEqCDevSwitch::GetPosition(const DiSEqCDevSettings &settings) const if (pos >= (int)m_num_ports) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Port %1 ").arg(pos + 1) + + LOG(VB_GENERAL, LOG_ERR, QString("Port %1 ").arg(pos + 1) + QString("is not in range [0..%1)").arg(m_num_ports)); return -1; @@ -1617,7 +1614,7 @@ int DiSEqCDevSwitch::GetPosition(const DiSEqCDevSettings &settings) const if ((pos >= 0) && !m_children[pos]) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Port %1 ").arg(pos + 1) + + LOG(VB_GENERAL, LOG_ERR, QString("Port %1 ").arg(pos + 1) + "has no connected devices configured."); return -1; @@ -1682,7 +1679,7 @@ bool DiSEqCDevRotor::Execute(const DiSEqCDevSettings &settings, break; default: success = false; - VERBOSE(VB_IMPORTANT, LOC_ERR + "Unknown rotor type " + + LOG(VB_GENERAL, LOG_ERR, "Unknown rotor type " + QString("(%1)").arg((uint) m_type)); break; } @@ -1762,8 +1759,8 @@ uint DiSEqCDevRotor::GetVoltage(const DiSEqCDevSettings &settings, // override voltage if the last position is known and the rotor is moving if (IsMoving(settings)) { - VERBOSE(VB_CHANNEL, LOC + - "Overriding voltage to 18V for faster rotor movement"); + LOG(VB_CHANNEL, LOG_INFO, + "Overriding voltage to 18V for faster rotor movement"); } else if (m_child) { @@ -1983,7 +1980,7 @@ bool DiSEqCDevRotor::ExecuteRotor(const DiSEqCDevSettings&, const DTVMultiplex&, StartRotorPositionTracking(CalculateAzimuth(angle)); } - VERBOSE(VB_CHANNEL, LOC + "Rotor - " + + LOG(VB_CHANNEL, LOG_INFO, "Rotor - " + QString("Goto Stored Position %1").arg(index)); return m_tree.SendCommand(DISEQC_ADR_POS_AZ, DISEQC_CMD_GOTO_POS, @@ -1996,7 +1993,7 @@ bool DiSEqCDevRotor::ExecuteUSALS(const DiSEqCDevSettings&, const DTVMultiplex&, double azimuth = CalculateAzimuth(angle); StartRotorPositionTracking(azimuth); - VERBOSE(VB_CHANNEL, LOC + "USALS Rotor - " + + LOG(VB_CHANNEL, LOG_INFO, "USALS Rotor - " + QString("Goto %1 (Azimuth %2)").arg(angle).arg(azimuth)); uint az16 = (uint) (abs(azimuth) * 16.0); diff --git a/mythtv/libs/libmythtv/diseqcsettings.cpp b/mythtv/libs/libmythtv/diseqcsettings.cpp index cabbdcd456a..8aad18fbd32 100644 --- a/mythtv/libs/libmythtv/diseqcsettings.cpp +++ b/mythtv/libs/libmythtv/diseqcsettings.cpp @@ -918,8 +918,8 @@ bool DeviceTree::EditNodeDialog(uint nodeid) DiSEqCDevDevice *dev = m_tree.FindDevice(nodeid); if (!dev) { - VERBOSE(VB_IMPORTANT, QString("DeviceTree::EditNodeDialog(%1) " - "-- device not found").arg(nodeid)); + LOG(VB_GENERAL, LOG_ERR, QString("DeviceTree::EditNodeDialog(%1) " + "-- device not found").arg(nodeid)); return false; } @@ -1550,7 +1550,7 @@ bool convert_diseqc_db(void) default: { - VERBOSE(VB_IMPORTANT, QString("Unknown DiSEqC device type ") + + LOG(VB_GENERAL, LOG_ERR, "Unknown DiSEqC device type " + QString("%1 ignoring card %2").arg(type).arg(cardid)); break; } diff --git a/mythtv/libs/libmythtv/dsmcc.cpp b/mythtv/libs/libmythtv/dsmcc.cpp index 5d3dfec8d72..b5cc09113e8 100644 --- a/mythtv/libs/libmythtv/dsmcc.cpp +++ b/mythtv/libs/libmythtv/dsmcc.cpp @@ -91,8 +91,8 @@ ObjCarousel *Dsmcc::AddTap(unsigned short componentTag, unsigned carouselId) if (it == car->m_Tags.end()) { // Not there. car->m_Tags.push_back(componentTag); - VERBOSE(VB_DSMCC, QString("[dsmcc] Adding tap for stream " - "tag %1 with carousel %2") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Adding tap for stream " + "tag %1 with carousel %2") .arg(componentTag).arg(carouselId)); } @@ -112,7 +112,7 @@ bool Dsmcc::ProcessSectionHeader(DsmccSectionHeader *header, * else skip packet */ if (((header->flags[0] & 0x80) == 0) || (header->flags[0] & 0x40) != 0) { - VERBOSE(VB_DSMCC, "[dsmcc] Invalid section\n"); + LOG(VB_DSMCC, LOG_ERR, "[dsmcc] Invalid section"); return false; } @@ -168,7 +168,7 @@ void Dsmcc::ProcessDownloadServerInitiate(const unsigned char *data, return; /* TODO error */ } - VERBOSE(VB_DSMCC, QString("[dsmcc] Gateway Module %1 on carousel %2") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Gateway Module %1 on carousel %2") .arg(gatewayProfile.m_profile_body->GetReference()->m_nModuleId) .arg(gatewayProfile.m_profile_body-> GetReference()->m_nCarouselId)); @@ -176,8 +176,8 @@ void Dsmcc::ProcessDownloadServerInitiate(const unsigned char *data, // This provides us with a map from component tag to carousel ID. ProfileBodyFull *full = (ProfileBodyFull*)gatewayProfile.m_profile_body; - VERBOSE(VB_DSMCC, QString("[dsmcc] DSI tap identifies " - "tag %1 with carousel %2") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] DSI tap identifies " + "tag %1 with carousel %2") .arg(full->dsm_conn.tap.assoc_tag) .arg(gatewayProfile.m_profile_body-> GetReference()->m_nCarouselId)); @@ -220,8 +220,8 @@ void Dsmcc::ProcessDownloadInfoIndication(const unsigned char *data, if (car == NULL) { - VERBOSE(VB_DSMCC, QString("[dsmcc] Section Info for " - "unknown carousel %1") + LOG(VB_DSMCC, LOG_ERR, QString("[dsmcc] Section Info for " + "unknown carousel %1") .arg(dii.download_id)); // No known carousels yet (possible?) return; @@ -253,8 +253,8 @@ void Dsmcc::ProcessDownloadInfoIndication(const unsigned char *data, dii.modules[i].module_version = data[off++]; dii.modules[i].module_info_len = data[off++]; - VERBOSE(VB_DSMCC, QString("[dsmcc] Module %1 -> " - "Size = %2 Version = %3") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Module %1 -> " + "Size = %2 Version = %3") .arg(dii.modules[i].module_id) .arg(dii.modules[i].module_size) .arg(dii.modules[i].module_version)); @@ -309,7 +309,7 @@ void Dsmcc::ProcessSectionIndication(const unsigned char *data, if (message_id == DSMCC_MESSAGE_DSI) { - VERBOSE(VB_DSMCC, "[dsmcc] Server Gateway"); + LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Server Gateway"); // We only process DSI messages if they are received on the initial // stream. Because we add taps eagerly we could see a DSI on a // different stream before we see the one we actually want. @@ -320,19 +320,19 @@ void Dsmcc::ProcessSectionIndication(const unsigned char *data, } else { - VERBOSE(VB_DSMCC, QString("[dsmcc] Discarding DSI from tag %1") - .arg(streamTag)); + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Discarding DSI from tag %1") .arg(streamTag)); } // Otherwise discard it. } else if (message_id == DSMCC_MESSAGE_DII) { - VERBOSE(VB_DSMCC, "[dsmcc] Module Info"); + LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Module Info"); ProcessDownloadInfoIndication(data + DSMCC_DII_OFFSET, streamTag); } else { - VERBOSE(VB_DSMCC, "[dsmcc] Unknown section"); + LOG(VB_DSMCC, LOG_ERR, "[dsmcc] Unknown section"); /* Error */ } @@ -365,7 +365,8 @@ void Dsmcc::ProcessSectionData(const unsigned char *data, int length) ddb.block_number = (blockData[4] << 8) | blockData[5]; ddb.len = message_len - 6; - VERBOSE(VB_DSMCC, QString("[dsmcc] Data Block ModID %1 Pos %2 Version %3") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Data Block ModID %1 Pos %2 Version %3") .arg(ddb.module_id).arg(ddb.block_number).arg(ddb.module_version)); ObjCarousel *car = GetCarouselById(download_id); @@ -392,8 +393,8 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length, QLinkedList::iterator it = carousels.begin(); ObjCarousel *car = NULL; - VERBOSE(VB_DSMCC, QString("[dsmcc] Read block size %1 from tag %2 " - "carousel id %3 data broadcast Id %4") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Read block size %1 from tag %2 " + "carousel id %3 data broadcast Id %4") .arg(length).arg(componentTag) .arg(carouselId).arg(dataBroadcastId)); @@ -428,7 +429,7 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length, if (!found) { - VERBOSE(VB_DSMCC, QString("[dsmcc] Dropping block from tag %1") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Dropping block from tag %1") .arg(componentTag)); return; // Ignore this stream. @@ -441,8 +442,8 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length, if (crc32_decode != 0) { - VERBOSE(VB_DSMCC, - QString("[dsmcc] Dropping corrupt section (Got %1)") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Dropping corrupt section (Got %1)") .arg(crc32_decode)); return; } @@ -450,19 +451,19 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length, switch (data[0]) { case DSMCC_SECTION_INDICATION: - VERBOSE(VB_DSMCC, "[dsmcc] Server/Info Section"); + LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Server/Info Section"); ProcessSectionIndication(data, length, componentTag); break; case DSMCC_SECTION_DATA: - VERBOSE(VB_DSMCC, "[dsmcc] Data Section"); + LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Data Section"); ProcessSectionData(data, length); break; case DSMCC_SECTION_DESCR: - VERBOSE(VB_DSMCC, "[dsmcc] Descriptor Section"); + LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Descriptor Section"); ProcessSectionDesc(data, length); break; default: - VERBOSE(VB_DSMCC, QString("[dsmcc] Unknown Section %1") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Unknown Section %1") .arg(data[0])); break; } @@ -471,7 +472,7 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length, // Reset the object carousel and clear the caches. void Dsmcc::Reset() { - VERBOSE(VB_DSMCC, "Resetting carousel"); + LOG(VB_DSMCC, LOG_INFO, "Resetting carousel"); QLinkedList::iterator it = carousels.begin(); for (; it != carousels.end(); ++it) delete *it; diff --git a/mythtv/libs/libmythtv/dsmccbiop.cpp b/mythtv/libs/libmythtv/dsmccbiop.cpp index 253fee1e053..5eb530da2b2 100644 --- a/mythtv/libs/libmythtv/dsmccbiop.cpp +++ b/mythtv/libs/libmythtv/dsmccbiop.cpp @@ -115,8 +115,8 @@ bool BiopMessage::Process(DSMCCCacheModuleData *cachep, DSMCCCache *filecache, // Parse header if (! ProcessMsgHdr(data, curp)) { - VERBOSE(VB_DSMCC,"[biop] Invalid biop header, " - "dropping rest of module"); + LOG(VB_DSMCC, LOG_ERR, + "[biop] Invalid biop header, dropping rest of module"); /* not valid, skip rest of data */ return false; @@ -125,23 +125,23 @@ bool BiopMessage::Process(DSMCCCacheModuleData *cachep, DSMCCCache *filecache, // Handle each message type if (strcmp(m_objkind, "fil") == 0) { - VERBOSE(VB_DSMCC,"[biop] Processing file"); + LOG(VB_DSMCC, LOG_INFO, "[biop] Processing file"); return ProcessFile(cachep, filecache, data, curp); } else if (strcmp(m_objkind, "dir") == 0) { - VERBOSE(VB_DSMCC,"[biop] Processing directory"); + LOG(VB_DSMCC, LOG_INFO, "[biop] Processing directory"); return ProcessDir(false, cachep, filecache, data, curp); } else if (strcmp(m_objkind, "srg") == 0) { - VERBOSE(VB_DSMCC,"[biop] Processing gateway"); + LOG(VB_DSMCC, LOG_INFO, "[biop] Processing gateway"); return ProcessDir(true, cachep, filecache, data, curp); } else { /* Error */ - VERBOSE(VB_DSMCC, QString("Unknown or unsupported format %1%2%3%4") + LOG(VB_DSMCC, LOG_ERR, QString("Unknown or unsupported format %1%2%3%4") .arg(m_objkind[0]).arg(m_objkind[1]) .arg(m_objkind[2]).arg(m_objkind[3])); return false; @@ -161,7 +161,7 @@ bool BiopMessage::ProcessMsgHdr(unsigned char *data, unsigned long *curp) if (buf[0] !='B' || buf[1] !='I' || buf[2] !='O' || buf[3] !='P') { - VERBOSE(VB_DSMCC, "BiopMessage - invalid header"); + LOG(VB_DSMCC, LOG_ERR, "BiopMessage - invalid header"); return false; } @@ -225,7 +225,7 @@ bool BiopMessage::ProcessDir( else pDir = filecache->Directory(ref); - VERBOSE(VB_DSMCC, QString("[Biop] Processing %1 reference %2") + LOG(VB_DSMCC, LOG_INFO, QString("[Biop] Processing %1 reference %2") .arg(isSrg ? "gateway" : "directory").arg(ref.toString())); for (uint i = 0; i < bindings_count; i++) @@ -427,7 +427,7 @@ int BiopObjLocation::Process(const unsigned char *data) // a different PMT, We don't support that, at least at the moment. int ProfileBodyLite::Process(const unsigned char * /*data*/) { - VERBOSE(VB_DSMCC, "Found LiteProfileBody - Not Implemented Yet"); + LOG(VB_DSMCC, LOG_INFO, "Found LiteProfileBody - Not Implemented Yet"); return 0; } diff --git a/mythtv/libs/libmythtv/dsmcccache.cpp b/mythtv/libs/libmythtv/dsmcccache.cpp index 519b901ee4b..9a4a5c17191 100644 --- a/mythtv/libs/libmythtv/dsmcccache.cpp +++ b/mythtv/libs/libmythtv/dsmcccache.cpp @@ -138,7 +138,7 @@ DSMCCCacheDir *DSMCCCache::Srg(const DSMCCCacheReference &ref) if (dir != m_Gateways.end()) { - VERBOSE(VB_DSMCC, QString("[DSMCCCache] Already seen gateway %1") + LOG(VB_DSMCC, LOG_ERR, QString("[DSMCCCache] Already seen gateway %1") .arg(ref.toString())); return NULL; } @@ -158,7 +158,7 @@ DSMCCCacheDir *DSMCCCache::Directory(const DSMCCCacheReference &ref) if (dir != m_Directories.end()) { - VERBOSE(VB_DSMCC, QString("[DSMCCCache] Already seen directory %1") + LOG(VB_DSMCC, LOG_ERR, QString("[DSMCCCache] Already seen directory %1") .arg(ref.toString())); return NULL; } @@ -176,8 +176,8 @@ void DSMCCCache::CacheFileData(const DSMCCCacheReference &ref, DSMCCCacheFile *pFile; // Do we have the file already? - VERBOSE(VB_DSMCC, - QString("[DSMCCCache] Adding file data size %1 for reference %2") + LOG(VB_DSMCC, LOG_INFO, + QString("[DSMCCCache] Adding file data size %1 for reference %2") .arg(data.size()).arg(ref.toString())); QMap::Iterator fil = @@ -208,8 +208,8 @@ void DSMCCCache::AddFileInfo(DSMCCCacheDir *pDir, const BiopBinding *pBB) pDir->m_Files.insert(name, *entry); - VERBOSE(VB_DSMCC, - QString("[DSMCCCache] Adding file with name %1 reference %2") + LOG(VB_DSMCC, LOG_INFO, + QString("[DSMCCCache] Adding file with name %1 reference %2") .arg(name).arg(entry->toString())); } @@ -225,8 +225,8 @@ void DSMCCCache::AddDirInfo(DSMCCCacheDir *pDir, const BiopBinding *pBB) pDir->m_SubDirectories.insert(name, *entry); - VERBOSE(VB_DSMCC, - QString("[DSMCCCache] Adding directory with name %1 reference %2") + LOG(VB_DSMCC, LOG_INFO, + QString("[DSMCCCache] Adding directory with name %1 reference %2") .arg(name).arg(entry->toString())); } @@ -321,7 +321,8 @@ int DSMCCCache::GetDSMObject(QStringList &objectPath, QByteArray &result) // Set the gateway reference from a DSI message. void DSMCCCache::SetGateway(const DSMCCCacheReference &ref) { - VERBOSE(VB_DSMCC, QString("[DSMCCCache] Setting gateway to reference %1") + LOG(VB_DSMCC, LOG_INFO, + QString("[DSMCCCache] Setting gateway to reference %1") .arg(ref.toString())); m_GatewayRef = ref; diff --git a/mythtv/libs/libmythtv/dsmccobjcarousel.cpp b/mythtv/libs/libmythtv/dsmccobjcarousel.cpp index 69aefd2f6c6..e06ccab136b 100644 --- a/mythtv/libs/libmythtv/dsmccobjcarousel.cpp +++ b/mythtv/libs/libmythtv/dsmccobjcarousel.cpp @@ -52,13 +52,14 @@ unsigned char *DSMCCCacheModuleData::AddModuleData(DsmccDb *ddb, return NULL; // Already got it. // Check if we have this block already or not. If not append to list - VERBOSE(VB_DSMCC, QString("[dsmcc] Module %1 block number %2 length %3") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Module %1 block number %2 length %3") .arg(ddb->module_id).arg(ddb->block_number).arg(ddb->len)); if (ddb->block_number >= m_blocks.size()) { - VERBOSE(VB_DSMCC, QString("[dsmcc] Module %1 block number %2 " - "is larger than %3") + LOG(VB_DSMCC, LOG_ERR, + QString("[dsmcc] Module %1 block number %2 is larger than %3") .arg(ddb->module_id).arg(ddb->block_number) .arg(m_blocks.size())); @@ -73,14 +74,15 @@ unsigned char *DSMCCCacheModuleData::AddModuleData(DsmccDb *ddb, m_receivedData += ddb->len; } - VERBOSE(VB_DSMCC, QString("[dsmcc] Module %1 Current Size %2 " - "Total Size %3") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Module %1 Current Size %2 Total Size %3") .arg(m_module_id).arg(m_receivedData).arg(m_moduleSize)); if (m_receivedData < m_moduleSize) return NULL; // Not yet complete - VERBOSE(VB_DSMCC, QString("[dsmcc] Reconstructing module %1 from blocks") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Reconstructing module %1 from blocks") .arg(m_module_id)); // Re-assemble the blocks into the complete module. @@ -103,15 +105,15 @@ unsigned char *DSMCCCacheModuleData::AddModuleData(DsmccDb *ddb, if (m_descriptorData.isCompressed) { unsigned long dataLen = m_descriptorData.originalSize + 1; - VERBOSE(VB_DSMCC, QString("[dsmcc] uncompressing: " - "compressed size %1, final size %2") + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] uncompressing: compressed size %1, final size %2") .arg(m_moduleSize).arg(dataLen)); unsigned char *uncompressed = (unsigned char*) malloc(dataLen + 1); int ret = uncompress(uncompressed, &dataLen, tmp_data, m_moduleSize); if (ret != Z_OK) { - VERBOSE(VB_DSMCC,"[dsmcc] compression error, skipping"); + LOG(VB_DSMCC, LOG_ERR, "[dsmcc] compression error, skipping"); free(tmp_data); free(uncompressed); return NULL; @@ -161,24 +163,23 @@ void ObjCarousel::AddModuleInfo(DsmccDii *dii, Dsmcc *status, /* already known */ if (cachep->Version() == info->module_version) { - VERBOSE(VB_DSMCC, QString("[dsmcc] Already Know " - "Module %1") + LOG(VB_DSMCC, LOG_ERR, + QString("[dsmcc] Already Know Module %1") .arg(info->module_id)); if (cachep->ModuleSize() == info->module_size) return; // It seems that when ITV4 starts broadcasting it // updates the contents of a file but doesn't // update the version. This is a work-around. - VERBOSE(VB_DSMCC, QString("[dsmcc] Module %1 size " - "has changed (%2 to %3) " - "but version has not!!") + LOG(VB_DSMCC, LOG_ERR, + QString("[dsmcc] Module %1 size has changed (%2 to %3) " + "but version has not!!") .arg(info->module_id) .arg(info->module_size) .arg(cachep->DataSize())); } // Version has changed - Drop old data. - VERBOSE(VB_DSMCC, QString("[dsmcc] Updated " - "Module %1") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Updated Module %1") .arg(info->module_id)); // Remove and delete the cache object. @@ -188,15 +189,15 @@ void ObjCarousel::AddModuleInfo(DsmccDii *dii, Dsmcc *status, } } - VERBOSE(VB_DSMCC, QString("[dsmcc] Saving info for module %1") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Saving info for module %1") .arg(dii->modules[i].module_id)); // Create a new cache module data object. - DSMCCCacheModuleData *cachep = new DSMCCCacheModuleData(dii, info, streamTag); - + DSMCCCacheModuleData *cachep = new DSMCCCacheModuleData(dii, info, + streamTag); int tag = info->modinfo.tap.assoc_tag; - VERBOSE(VB_DSMCC, QString("[dsmcc] Module info tap " - "identifies tag %1 with carousel %2\n") + LOG(VB_DSMCC, LOG_INFO, QString("[dsmcc] Module info tap identifies " + "tag %1 with carousel %2") .arg(tag).arg(cachep->CarouselId())); // If a carousel with this id does not exist create it. @@ -215,7 +216,8 @@ void ObjCarousel::AddModuleInfo(DsmccDii *dii, Dsmcc *status, void ObjCarousel::AddModuleData(unsigned long carousel, DsmccDb *ddb, const unsigned char *data) { - VERBOSE(VB_DSMCC, QString("[dsmcc] Data block on carousel %1").arg(m_id)); + LOG(VB_DSMCC, LOG_INFO, + QString("[dsmcc] Data block on carousel %1").arg(m_id)); // Search the saved module info for this module QLinkedList::iterator it = m_Cache.begin(); @@ -241,8 +243,8 @@ void ObjCarousel::AddModuleData(unsigned long carousel, DsmccDb *ddb, // It is complete and we have the data unsigned int len = cachep->DataSize(); unsigned long curp = 0; - VERBOSE(VB_DSMCC, QString("[biop] Module size (uncompressed) = %1") - .arg(len)); + LOG(VB_DSMCC, LOG_INFO, + QString("[biop] Module size (uncompressed) = %1") .arg(len)); // Now process the BIOP tables in this module. // Tables may be file contents or the descriptions of diff --git a/mythtv/libs/libmythtv/dtvchannel.cpp b/mythtv/libs/libmythtv/dtvchannel.cpp index 87534a646d2..60a17c982db 100644 --- a/mythtv/libs/libmythtv/dtvchannel.cpp +++ b/mythtv/libs/libmythtv/dtvchannel.cpp @@ -176,13 +176,13 @@ bool DTVChannel::SetChannelByString(const QString &channum) { QString loc = LOC + QString("SetChannelByString(%1)").arg(channum); QString loc_err = loc + ", Error: "; - VERBOSE(VB_CHANNEL, loc); + LOG(VB_CHANNEL, LOG_INFO, loc); ClearDTVInfo(); if (!IsOpen() && !Open()) { - VERBOSE(VB_IMPORTANT, loc_err + "Channel object " + LOG(VB_GENERAL, LOG_ERR, loc + "Channel object " "will not open, can not change channels."); return false; @@ -193,7 +193,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) QString inputName; if (!CheckChannel(channum, inputName)) { - VERBOSE(VB_IMPORTANT, loc_err + + LOG(VB_GENERAL, LOG_ERR, loc + "CheckChannel failed.\n\t\t\tPlease verify the channel " "in the 'mythtv-setup' Channel Editor."); @@ -214,8 +214,8 @@ bool DTVChannel::SetChannelByString(const QString &channum) uint mplexid_restriction; if (!IsInputAvailable(m_currentInputID, mplexid_restriction)) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Requested channel '%1' is on input '%2' " + LOG(VB_GENERAL, LOG_INFO, loc + " " + + QString("Requested channel '%1' is on input '%2' " "which is in a busy input group") .arg(channum).arg(m_currentInputID)); @@ -236,16 +236,15 @@ bool DTVChannel::SetChannelByString(const QString &channum) si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, mplexid, m_commfree)) { - VERBOSE(VB_IMPORTANT, loc_err + - "Unable to find channel in database."); + LOG(VB_GENERAL, LOG_ERR, loc + "Unable to find channel in database."); return false; } if (mplexid_restriction && (mplexid != mplexid_restriction)) { - VERBOSE(VB_IMPORTANT, loc + " " + QString( - "Requested channel '%1' is not available because " + LOG(VB_GENERAL, LOG_ERR, loc + " " + + QString("Requested channel '%1' is not available because " "the tuner is currently in use on another transport.") .arg(channum)); @@ -289,7 +288,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) if ((*it)->name.contains("composite", Qt::CaseInsensitive) || (*it)->name.contains("s-video", Qt::CaseInsensitive)) { - VERBOSE(VB_GENERAL, LOC_WARN + "You have not set " + LOG(VB_GENERAL, LOG_WARNING, "You have not set " "an external channel changing" "\n\t\t\tscript for a composite or s-video " "input. Channel changing will do nothing."); @@ -303,7 +302,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) DTVMultiplex tuning; if (!mplexid || !tuning.FillFromDB(tunerType, mplexid)) { - VERBOSE(VB_IMPORTANT, loc_err + + LOG(VB_GENERAL, LOG_ERR, loc + "Failed to initialize multiplex options"); ok = false; } @@ -315,7 +314,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) // Tune to proper multiplex if (!Tune(tuning, (*it)->name)) { - VERBOSE(VB_IMPORTANT, loc_err + "Tuning to frequency."); + LOG(VB_GENERAL, LOG_ERR, loc + "Tuning to frequency."); ClearDTVInfo(); ok = false; @@ -328,7 +327,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) } } - VERBOSE(VB_CHANNEL, loc + " " + ((ok) ? "success" : "failure")); + LOG(VB_CHANNEL, LOG_INFO, loc + " " + ((ok) ? "success" : "failure")); if (!ok) return false; @@ -346,7 +345,7 @@ bool DTVChannel::SetChannelByString(const QString &channum) ChannelUtil::GetCachedPids(chanid, pid_cache); if (pid_cache.empty()) { - VERBOSE(VB_IMPORTANT, loc_err + "PID cache is empty"); + LOG(VB_GENERAL, LOG_ERR, loc + "PID cache is empty"); return false; } diff --git a/mythtv/libs/libmythtv/dtvconfparser.cpp b/mythtv/libs/libmythtv/dtvconfparser.cpp index 4be36d050fa..43ba4b5430f 100644 --- a/mythtv/libs/libmythtv/dtvconfparser.cpp +++ b/mythtv/libs/libmythtv/dtvconfparser.cpp @@ -304,7 +304,7 @@ void DTVConfParser::AddChannel(const DTVMultiplex &mux, DTVChannelInfo &chan) { channels[i].channels.push_back(chan); - VERBOSE(VB_IMPORTANT, "Imported channel: " + chan.toString() + + LOG(VB_GENERAL, LOG_INFO, "Imported channel: " + chan.toString() + " on " + mux.toString()); return; } @@ -313,6 +313,6 @@ void DTVConfParser::AddChannel(const DTVMultiplex &mux, DTVChannelInfo &chan) channels.push_back(mux); channels.back().channels.push_back(chan); - VERBOSE(VB_IMPORTANT, "Imported channel: " + chan.toString() + + LOG(VB_GENERAL, LOG_INFO, "Imported channel: " + chan.toString() + " on " + mux.toString()); } diff --git a/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp b/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp index 81076bf25d0..1ee13d5993c 100644 --- a/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp +++ b/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp @@ -29,8 +29,8 @@ QString DTVParamHelper::toString(const char *strings[], int index, { if ((index < 0) || ((uint)index >= strings_size)) { - VERBOSE(VB_IMPORTANT, - "DTVParamHelper::toString() index out of bounds"); + LOG(VB_GENERAL, LOG_CRIT, + "DTVParamHelper::toString() index out of bounds"); return QString::null; } diff --git a/mythtv/libs/libmythtv/dtvmultiplex.cpp b/mythtv/libs/libmythtv/dtvmultiplex.cpp index 122c3fa3068..bba9b94c4b7 100644 --- a/mythtv/libs/libmythtv/dtvmultiplex.cpp +++ b/mythtv/libs/libmythtv/dtvmultiplex.cpp @@ -153,7 +153,7 @@ bool DTVMultiplex::ParseATSC(const QString &_frequency, frequency = _frequency.toULongLong(&ok); if (!ok) { - VERBOSE(VB_IMPORTANT, QString("Failed to parse ATSC frequency %1") + LOG(VB_GENERAL, LOG_ERR, QString("Failed to parse ATSC frequency %1") .arg(_frequency)); return false; } @@ -161,7 +161,7 @@ bool DTVMultiplex::ParseATSC(const QString &_frequency, ok = modulation.Parse(_modulation); if (!ok) { - VERBOSE(VB_IMPORTANT, QString("Failed to parse ATSC modulation %1") + LOG(VB_GENERAL, LOG_ERR, QString("Failed to parse ATSC modulation %1") .arg(_modulation)); } return ok; @@ -177,8 +177,8 @@ bool DTVMultiplex::ParseDVB_T( bool ok = inversion.Parse(_inversion); if (!ok) { - VERBOSE(VB_GENERAL, LOC_WARN + - "Invalid inversion, falling back to 'auto'."); + LOG(VB_GENERAL, LOG_WARNING, + "Invalid inversion, falling back to 'auto'."); ok = true; } @@ -203,8 +203,8 @@ bool DTVMultiplex::ParseDVB_S_and_C( bool ok = inversion.Parse(_inversion); if (!ok) { - VERBOSE(VB_GENERAL, LOC_WARN + - "Invalid inversion, falling back to 'auto'"); + LOG(VB_GENERAL, LOG_WARNING, + "Invalid inversion, falling back to 'auto'"); ok = true; } @@ -212,8 +212,8 @@ bool DTVMultiplex::ParseDVB_S_and_C( symbolrate = _symbol_rate.toInt(); if (!symbolrate) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + - QString("parameter '%1', aborting.").arg(_symbol_rate)); + LOG(VB_GENERAL, LOG_ERR, "Invalid symbol rate " + + QString("parameter '%1', aborting.").arg(_symbol_rate)); return false; } @@ -241,7 +241,7 @@ bool DTVMultiplex::ParseDVB_S2( if (!mod_sys.Parse(_mod_sys)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid S2 modulation system " + + LOG(VB_GENERAL, LOG_ERR, "Invalid S2 modulation system " + QString("parameter '%1', aborting.").arg(_mod_sys)); return false; } @@ -288,7 +288,7 @@ bool DTVMultiplex::ParseTuningParams( if (DTVTunerType::kTunerTypeATSC == type) return ParseATSC(_frequency, _modulation); - VERBOSE(VB_IMPORTANT, LOC_ERR + "ParseTuningParams -- Unknown tuner type"); + LOG(VB_GENERAL, LOG_ERR, "ParseTuningParams -- Unknown tuner type"); return false; } @@ -317,8 +317,8 @@ bool DTVMultiplex::FillFromDB(DTVTunerType type, uint mplexid) if (!query.next()) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Could not find tuning parameters for mplex %1") + LOG(VB_GENERAL, LOG_ERR, + QString("Could not find tuning parameters for mplex %1") .arg(mplexid)); return false; @@ -372,8 +372,8 @@ bool DTVMultiplex::FillFromDeliverySystemDesc(DTVTunerType type, { if (cd.ModulationSystem()) { - VERBOSE(VB_CHANSCAN, - "Ignoring DVB-S2 transponder with DVB-S card"); + LOG(VB_CHANSCAN, LOG_NOTICE, + "Ignoring DVB-S2 transponder with DVB-S card"); return false; } @@ -409,11 +409,12 @@ bool DTVMultiplex::FillFromDeliverySystemDesc(DTVTunerType type, cd.ModulationString(), QString()); } default: - VERBOSE(VB_CHANSCAN, "unknown delivery system descriptor"); + LOG(VB_CHANSCAN, LOG_ERR, "unknown delivery system descriptor"); return false; } - VERBOSE(VB_CHANSCAN, QString("Tuner type %1 does not match delivery system") + LOG(VB_CHANSCAN, LOG_ERR, + QString("Tuner type %1 does not match delivery system") .arg(type.toString())); return false; } diff --git a/mythtv/libs/libmythtv/dtvrecorder.cpp b/mythtv/libs/libmythtv/dtvrecorder.cpp index b3f76bcd18b..da334aefd3e 100644 --- a/mythtv/libs/libmythtv/dtvrecorder.cpp +++ b/mythtv/libs/libmythtv/dtvrecorder.cpp @@ -166,7 +166,7 @@ void DTVRecorder::FinishRecording(void) void DTVRecorder::ResetForNewFile(void) { - VERBOSE(VB_RECORD, LOC + "ResetForNewFile(void)"); + LOG(VB_RECORD, LOG_INFO, LOC + "ResetForNewFile(void)"); QMutexLocker locker(&positionMapLock); // _first_keyframe, _seen_psp and m_h264_parser should @@ -207,7 +207,7 @@ void DTVRecorder::ResetForNewFile(void) // documented in recorderbase.h void DTVRecorder::Reset(void) { - VERBOSE(VB_RECORD, LOC + "Reset(void)"); + LOG(VB_RECORD, LOG_INFO, LOC + "Reset(void)"); ResetForNewFile(); _start_code = 0xffffffff; @@ -413,7 +413,7 @@ bool DTVRecorder::FindMPEG2Keyframes(const TSPacket* tspacket) if (frameRate && frameRate != m_frameRate) { m_frameRate = frameRate; - VERBOSE(VB_RECORD, QString("FindMPEG2Keyframes: frame rate = %1") + LOG(VB_RECORD, LOG_INFO, QString("FindMPEG2Keyframes: frame rate = %1") .arg(frameRate)); FrameRateChange(frameRate, _frames_written_count); } @@ -467,7 +467,7 @@ bool DTVRecorder::FindOtherKeyframes(const TSPacket *tspacket) if (_has_written_other_keyframe) return true; - VERBOSE(VB_RECORD, LOC + "DSMCC - FindOtherKeyframes() - " + LOG(VB_RECORD, LOG_INFO, LOC + "DSMCC - FindOtherKeyframes() - " "generating initial key-frame"); _frames_seen_count++; @@ -484,7 +484,7 @@ bool DTVRecorder::FindOtherKeyframes(const TSPacket *tspacket) // documented in recorderbase.h void DTVRecorder::SetNextRecording(const ProgramInfo *progInf, RingBuffer *rb) { - VERBOSE(VB_RECORD, LOC + QString("SetNextRecord(0x%1, 0x%2)") + LOG(VB_RECORD, LOG_INFO, LOC + QString("SetNextRecord(0x%1, 0x%2)") .arg((uint64_t)progInf,0,16).arg((uint64_t)rb,0,16)); // First we do some of the time consuming stuff we can do now SavePositionMap(true); @@ -553,7 +553,7 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) { if (!ringBuffer) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "FindH264Keyframes: No ringbuffer"); + LOG(VB_GENERAL, LOG_ERR, "FindH264Keyframes: No ringbuffer"); return false; } @@ -587,8 +587,9 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) // bounds check if (i + 2 >= TSPacket::kSize) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "PES packet start code may overflow to next TS packet, aborting keyframe search"); + LOG(VB_GENERAL, LOG_ERR, + "PES packet start code may overflow to next TS packet, " + "aborting keyframe search"); break; } @@ -597,7 +598,7 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) tspacket->data()[i++] != 0x00 || tspacket->data()[i++] != 0x01) { - VERBOSE(VB_IMPORTANT, LOC_ERR + + LOG(VB_GENERAL, LOG_ERR, "PES start code not found in TS packet with PUSI set"); break; } @@ -605,8 +606,9 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) // bounds check if (i + 5 >= TSPacket::kSize) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "PES packet headers overflow to next TS packet, aborting keyframe search"); + LOG(VB_GENERAL, LOG_ERR, + "PES packet headers overflow to next TS packet, " + "aborting keyframe search"); break; } @@ -621,17 +623,21 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) // bounds check if ((i + 6 + pes_header_length) >= TSPacket::kSize) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "PES packet headers overflow to next TS packet, aborting keyframe search"); + LOG(VB_GENERAL, LOG_ERR, + "PES packet headers overflow to next TS packet, " + "aborting keyframe search"); break; } // we now know where the PES payload is - // normally, we should have used 6, but use 5 because the for loop will bump i + // normally, we should have used 6, but use 5 because the for + // loop will bump i i += 5 + pes_header_length; _pes_synced = true; - //VERBOSE(VB_RECORD, LOC + "PES synced"); +#if 0 + LOG(VB_RECORD, LOG_DEBUG, "PES synced"); +#endif continue; } @@ -693,7 +699,8 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) if (frameRate != 0 && frameRate != m_frameRate) { - VERBOSE( VB_RECORD, QString("FindH264Keyframes: timescale: %1, tick: %2, framerate: %3") + LOG(VB_RECORD, LOG_INFO, + QString("FindH264Keyframes: timescale: %1, tick: %2, framerate: %3") .arg( m_h264_parser.GetTimeScale() ) .arg( m_h264_parser.GetUnitsInTick() ) .arg( frameRate ) ); @@ -864,7 +871,7 @@ void DTVRecorder::FindPSKeyFrames(const uint8_t *buffer, uint len) if (frameRate && frameRate != m_frameRate) { m_frameRate = frameRate; - VERBOSE(VB_RECORD, QString("FindPSKeyFrames: frame rate = %1") + LOG(VB_RECORD, LOG_INFO, QString("FindPSKeyFrames: frame rate = %1") .arg(frameRate)); FrameRateChange(frameRate, _frames_written_count); } @@ -908,7 +915,7 @@ void DTVRecorder::FindPSKeyFrames(const uint8_t *buffer, uint len) _payload_buffer.resize(idx + rem); memcpy(&_payload_buffer[idx], bufstart, rem); #if 0 -VERBOSE(VB_GENERAL, QString("idx: %1, rem: %2").arg(idx).arg(rem) ); + LOG(VB_GENERAL, LOG_DEBUG, QString("idx: %1, rem: %2").arg(idx).arg(rem)); #endif } @@ -916,7 +923,7 @@ void DTVRecorder::HandlePAT(const ProgramAssociationTable *_pat) { if (!_pat) { - VERBOSE(VB_RECORD, LOC + "SetPAT(NULL)"); + LOG(VB_RECORD, LOG_ERR, LOC + "SetPAT(NULL)"); return; } @@ -927,12 +934,12 @@ void DTVRecorder::HandlePAT(const ProgramAssociationTable *_pat) if (!pmtpid) { - VERBOSE(VB_RECORD, LOC + "SetPAT(): " - "Ignoring PAT not containing our desired program..."); + LOG(VB_RECORD, LOG_ERR, LOC + "SetPAT(): " + "Ignoring PAT not containing our desired program..."); return; } - VERBOSE(VB_RECORD, LOC + QString("SetPAT(%1 on 0x%2)") + LOG(VB_RECORD, LOG_INFO, LOC + QString("SetPAT(%1 on 0x%2)") .arg(progNum).arg(pmtpid,0,16)); ProgramAssociationTable *oldpat = _input_pat; @@ -954,7 +961,7 @@ void DTVRecorder::HandlePMT(uint progNum, const ProgramMapTable *_pmt) if ((int)progNum == _stream_data->DesiredProgram()) { - VERBOSE(VB_RECORD, LOC + QString("SetPMT(%1)").arg(progNum)); + LOG(VB_RECORD, LOG_INFO, LOC + QString("SetPMT(%1)").arg(progNum)); ProgramMapTable *oldpmt = _input_pmt; _input_pmt = new ProgramMapTable(*_pmt); @@ -977,7 +984,7 @@ void DTVRecorder::HandleSingleProgramPAT(ProgramAssociationTable *pat) { if (!pat) { - VERBOSE(VB_RECORD, LOC + "HandleSingleProgramPAT(NULL)"); + LOG(VB_RECORD, LOG_ERR, LOC + "HandleSingleProgramPAT(NULL)"); return; } @@ -996,7 +1003,7 @@ void DTVRecorder::HandleSingleProgramPMT(ProgramMapTable *pmt) { if (!pmt) { - VERBOSE(VB_RECORD, LOC + "HandleSingleProgramPMT(NULL)"); + LOG(VB_RECORD, LOG_ERR, LOC + "HandleSingleProgramPMT(NULL)"); return; } @@ -1028,8 +1035,8 @@ bool DTVRecorder::ProcessTSPacket(const TSPacket &tspacket) { _continuity_error_count++; double erate = _continuity_error_count * 100.0 / _packet_count; - VERBOSE(VB_RECORD, LOC_WARN + - QString("PID 0x%1 discontinuity detected ((%2+1)%16!=%3) %4\%") + LOG(VB_RECORD, LOG_WARNING, + QString("PID 0x%1 discontinuity detected ((%2+1)%16!=%3) %4\%") .arg(pid,0,16).arg(old_cnt,2) .arg(tspacket.ContinuityCounter(),2) .arg(erate)); @@ -1100,9 +1107,8 @@ bool DTVRecorder::ProcessAVTSPacket(const TSPacket &tspacket) { _continuity_error_count++; double erate = _continuity_error_count * 100.0 / _packet_count; - VERBOSE(VB_RECORD, LOC_WARN + - QString("A/V PID 0x%1 discontinuity detected " - "((%2+1)%16!=%3) %4\%") + LOG(VB_RECORD, LOG_WARNING, + QString("A/V PID 0x%1 discontinuity detected ((%2+1)%16!=%3) %4\%") .arg(pid,0,16).arg(old_cnt).arg(tspacket.ContinuityCounter()) .arg(erate,5,'f',2)); } @@ -1118,8 +1124,8 @@ bool DTVRecorder::ProcessAVTSPacket(const TSPacket &tspacket) if (!tspacket.PayloadStart()) return true; // not payload start - drop packet - VERBOSE(VB_RECORD, - QString("PID 0x%1 Found Payload Start").arg(pid,0,16)); + LOG(VB_RECORD, LOG_INFO, + QString("PID 0x%1 Found Payload Start").arg(pid,0,16)); _pid_status[pid] |= kPayloadStartSeen; } diff --git a/mythtv/libs/libmythtv/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/dtvsignalmonitor.cpp index d2e55cc1294..e0747ea3da3 100644 --- a/mythtv/libs/libmythtv/dtvsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/dtvsignalmonitor.cpp @@ -10,7 +10,7 @@ #include "compat.h" #undef DBG_SM -#define DBG_SM(FUNC, MSG) VERBOSE(VB_CHANNEL, \ +#define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_INFO, \ QString("DTVSM(%1)::%2: %3").arg(channel->GetDevice()).arg(FUNC).arg(MSG)) #define LOC QString("DTVSM(%1): ").arg(channel->GetDevice()) @@ -300,12 +300,12 @@ void DTVSignalMonitor::HandlePAT(const ProgramAssociationTable *pat) last_pat_crc = pat->CRC(); QString errStr = QString("Program #%1 not found in PAT!") .arg(programNumber); - VERBOSE(VB_IMPORTANT, errStr + "\n" + pat->toString()); + LOG(VB_GENERAL, LOG_ERR, errStr + "\n" + pat->toString()); } if (pat->ProgramCount() == 1) { - VERBOSE(VB_IMPORTANT, "But there is only one program " - "in the PAT, so we'll just use it"); + LOG(VB_GENERAL, LOG_ERR, "But there is only one program " + "in the PAT, so we'll just use it"); SetProgramNumber(pat->ProgramNumber(0)); AddFlags(kDTVSigMon_PATMatch); GetStreamData()->AddListeningPID(pat->ProgramPID(0)); @@ -323,14 +323,14 @@ void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt) if (pmt->ProgramNumber() != (uint)programNumber) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Wrong PMT; pmt->pn(%1) desired(%2)") + LOG(VB_GENERAL, LOG_ERR, QString("Wrong PMT; pmt->pn(%1) desired(%2)") .arg(pmt->ProgramNumber()).arg(programNumber)); return; // Not the PMT we are looking for... } if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) { - VERBOSE(VB_IMPORTANT,QString("PMT says program %1 is encrypted").arg(programNumber)); + LOG(VB_GENERAL, LOG_NOTICE, + QString("PMT says program %1 is encrypted").arg(programNumber)); GetStreamData()->TestDecryption(pmt); } @@ -347,25 +347,26 @@ void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt) if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) && (hasAudio >= GetStreamData()->GetAudioStreamsRequired())) { - if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && !ignore_encrypted) + if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && + !ignore_encrypted) AddFlags(kDTVSigMon_WaitForCrypt); AddFlags(kDTVSigMon_PMTMatch); } else { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("We want %1 audio and %2 video streams") + LOG(VB_GENERAL, LOG_ERR, + QString("We want %1 audio and %2 video streams") .arg(GetStreamData()->GetAudioStreamsRequired()) .arg(GetStreamData()->GetVideoStreamsRequired()) + - QString("\n\t\t\tBut have %1 audio and %2 video streams") + QString("\n\t\t\tBut have %1 audio and %2 video streams") .arg(hasAudio).arg(hasVideo)); } } void DTVSignalMonitor::HandleSTT(const SystemTimeTable*) { - VERBOSE(VB_CHANNEL+VB_EXTRA, LOC + QString("Time Offset: %1") + LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1") .arg(GetStreamData()->TimeOffset())); } @@ -398,9 +399,9 @@ void DTVSignalMonitor::HandleTVCT( if (idx < 0) { - VERBOSE(VB_IMPORTANT, QString("Could not find channel %1_%2 in TVCT") + LOG(VB_GENERAL, LOG_ERR, QString("Could not find channel %1_%2 in TVCT") .arg(majorChannel).arg(minorChannel)); - VERBOSE(VB_IMPORTANT, "\n" + tvct->toString()); + LOG(VB_GENERAL, LOG_ERR, tvct->toString()); GetATSCStreamData()->SetVersionTVCT(tvct->TransportStreamID(),-1); return; } @@ -419,9 +420,9 @@ void DTVSignalMonitor::HandleCVCT(uint, const CableVirtualChannelTable* cvct) if (idx < 0) { - VERBOSE(VB_IMPORTANT, QString("Could not find channel %1_%2 in CVCT") + LOG(VB_GENERAL, LOG_ERR, QString("Could not find channel %1_%2 in CVCT") .arg(majorChannel).arg(minorChannel)); - VERBOSE(VB_IMPORTANT, "\n" + cvct->toString()); + LOG(VB_GENERAL, LOG_ERR, cvct->toString()); GetATSCStreamData()->SetVersionCVCT(cvct->TransportStreamID(),-1); return; } @@ -435,7 +436,7 @@ void DTVSignalMonitor::HandleCVCT(uint, const CableVirtualChannelTable* cvct) void DTVSignalMonitor::HandleTDT(const TimeDateTable*) { - VERBOSE(VB_CHANNEL+VB_EXTRA, LOC + QString("Time Offset: %1") + LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1") .arg(GetStreamData()->TimeOffset())); } diff --git a/mythtv/libs/libmythtv/dvbcam.cpp b/mythtv/libs/libmythtv/dvbcam.cpp index 7df02638089..40c992d44c2 100644 --- a/mythtv/libs/libmythtv/dvbcam.cpp +++ b/mythtv/libs/libmythtv/dvbcam.cpp @@ -105,7 +105,7 @@ bool DVBCam::Start(void) ciHandler = cCiHandler::CreateCiHandler(dev.constData()); if (!ciHandler) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to initialize CI handler"); + LOG(VB_GENERAL, LOG_ERR, "Failed to initialize CI handler"); return false; } @@ -117,7 +117,7 @@ bool DVBCam::Start(void) ciHandlerWait.wait(locker.mutex(), 1000); if (ciHandlerRunning) - VERBOSE(VB_DVBCAM, LOC + "CI handler successfully initialized!"); + LOG(VB_DVBCAM, LOG_INFO, "CI handler successfully initialized!"); return ciHandlerRunning; } @@ -163,8 +163,8 @@ void DVBCam::HandleUserIO(void) if (enq != NULL) { if (enq->Text() != NULL) - VERBOSE(VB_DVBCAM, LOC + "CAM: Received message: " + - enq->Text()); + LOG(VB_DVBCAM, LOG_INFO, QString("CAM: Received message: %1") + .arg(enq->Text())); delete enq; } @@ -172,34 +172,33 @@ void DVBCam::HandleUserIO(void) if (menu != NULL) { if (menu->TitleText() != NULL) - VERBOSE(VB_DVBCAM, LOC + "CAM: Menu Title: " + - menu->TitleText()); + LOG(VB_DVBCAM, LOG_INFO, QString("CAM: Menu Title: %1") + .arg(menu->TitleText())); if (menu->SubTitleText() != NULL) - VERBOSE(VB_DVBCAM, LOC + "CAM: Menu SubTitle: " + - menu->SubTitleText()); + LOG(VB_DVBCAM, LOG_INFO, QString("CAM: Menu SubTitle: %1") + .arg(menu->SubTitleText())); if (menu->BottomText() != NULL) - VERBOSE(VB_DVBCAM, LOC + "CAM: Menu BottomText: " + - menu->BottomText()); + LOG(VB_DVBCAM, LOG_INFO, QString("CAM: Menu BottomText: %1") + .arg(menu->BottomText())); for (int i=0; iNumEntries(); i++) if (menu->Entry(i) != NULL) - VERBOSE(VB_DVBCAM, LOC + "CAM: Menu Entry: " + - menu->Entry(i)); + LOG(VB_DVBCAM, LOG_INFO, QString("CAM: Menu Entry: %1") + .arg(menu->Entry(i))); if (menu->Selectable()) { - VERBOSE(VB_CHANNEL, LOC + "CAM: Menu is selectable"); + LOG(VB_CHANNEL, LOG_INFO, "CAM: Menu is selectable"); } if (menu->NumEntries() > 0) { - VERBOSE(VB_DVBCAM, LOC + - "CAM: Selecting first entry"); + LOG(VB_DVBCAM, LOG_INFO, "CAM: Selecting first entry"); menu->Select(0); } else { - VERBOSE(VB_DVBCAM, LOC + "CAM: Cancelling menu"); + LOG(VB_DVBCAM, LOG_INFO, "CAM: Cancelling menu"); } delete menu; @@ -208,7 +207,7 @@ void DVBCam::HandleUserIO(void) void DVBCam::HandlePMT(void) { - VERBOSE(VB_DVBCAM, LOC + "CiHandler needs CA_PMT"); + LOG(VB_DVBCAM, LOG_INFO, "CiHandler needs CA_PMT"); QMutexLocker locker(&pmt_lock); if (pmt_sent && pmt_added && !pmt_updated) @@ -261,7 +260,7 @@ void DVBCam::HandlePMT(void) void DVBCam::CiHandlerLoop() { - VERBOSE(VB_DVBCAM, LOC + "CI handler thread running"); + LOG(VB_DVBCAM, LOG_INFO, "CI handler thread running"); QMutexLocker locker(&ciHandlerLock); ciHandlerRunning = true; @@ -285,7 +284,7 @@ void DVBCam::CiHandlerLoop() } ciHandlerRunning = false; - VERBOSE(VB_DVBCAM, LOC + "CiHandler thread stopped"); + LOG(VB_DVBCAM, LOG_INFO, "CiHandler thread stopped"); } void DVBCam::SetPMT(const ChannelBase *chan, const ProgramMapTable *pmt) @@ -353,30 +352,31 @@ void DVBCam::SendPMT(const ProgramMapTable &pmt, uint cplm) if (!casids) { - VERBOSE(success ? VB_DVBCAM : VB_IMPORTANT, LOC_ERR + - "GetCaSystemIds returned NULL! " + - QString("(Slot #%1)").arg(s)); + LOG(success ? VB_DVBCAM : VB_GENERAL, LOG_ERR, + "GetCaSystemIds returned NULL! " + + QString("(Slot #%1)").arg(s)); continue; } if (!casids[0]) { - VERBOSE(success ? VB_DVBCAM : VB_IMPORTANT, LOC_ERR + "CAM supports no CA systems! " + - QString("(Slot #%1)").arg(s)); + LOG(success ? VB_DVBCAM : VB_GENERAL, LOG_ERR, + "CAM supports no CA systems! " + QString("(Slot #%1)").arg(s)); continue; } - VERBOSE(VB_DVBCAM, LOC + QString("Creating CA_PMT, ServiceID = %1") + LOG(VB_DVBCAM, LOG_INFO, QString("Creating CA_PMT, ServiceID = %1") .arg(pmt.ProgramNumber())); cCiCaPmt capmt = CreateCAPMT(pmt, casids, cplm); - VERBOSE(VB_DVBCAM, LOC + - QString("Sending CA_PMT with %1 to CI slot #%2") + LOG(VB_DVBCAM, LOG_INFO, + QString("Sending CA_PMT with %1 to CI slot #%2") .arg(cplm_info[cplm]).arg(s)); if (!ciHandler->SetCaPmt(capmt, s)) - VERBOSE(success ? VB_DVBCAM : VB_IMPORTANT, LOC + "CA_PMT send failed!"); + LOG(success ? VB_DVBCAM : VB_GENERAL, LOG_ERR, + LOC + "CA_PMT send failed!"); else success = true; } @@ -395,9 +395,8 @@ static void process_desc(cCiCaPmt &capmt, if (cad.SystemID() != casids[q]) continue; - VERBOSE(VB_DVBCAM, - QString("Adding CA descriptor: " - "CASID(0x%2), ECM PID(0x%3)") + LOG(VB_DVBCAM, LOG_INFO, + QString("Adding CA descriptor: CASID(0x%2), ECM PID(0x%3)") .arg(cad.SystemID(),0,16).arg(cad.PID(),0,16)); capmt.AddCaDescriptor(cad.SystemID(), cad.PID(), @@ -423,8 +422,8 @@ cCiCaPmt CreateCAPMT(const ProgramMapTable &pmt, // Add elementary streams + CA descriptors for (uint i = 0; i < pmt.StreamCount(); i++) { - VERBOSE(VB_DVBCAM, - QString("Adding elementary stream: %1, pid(0x%2)") + LOG(VB_DVBCAM, LOG_INFO, + QString("Adding elementary stream: %1, pid(0x%2)") .arg(pmt.StreamDescription(i, "dvb")) .arg(pmt.StreamPID(i),0,16)); diff --git a/mythtv/libs/libmythtv/dvbchannel.cpp b/mythtv/libs/libmythtv/dvbchannel.cpp index 86df5359f7d..4cdade57383 100644 --- a/mythtv/libs/libmythtv/dvbchannel.cpp +++ b/mythtv/libs/libmythtv/dvbchannel.cpp @@ -114,7 +114,7 @@ DVBChannel::~DVBChannel() void DVBChannel::Close(DVBChannel *who) { - VERBOSE(VB_CHANNEL, LOC + "Closing DVB channel"); + LOG(VB_CHANNEL, LOG_INFO, "Closing DVB channel"); IsOpenMap::iterator it = is_open.find(who); if (it == is_open.end()) @@ -150,7 +150,7 @@ void DVBChannel::Close(DVBChannel *who) bool DVBChannel::Open(DVBChannel *who) { - VERBOSE(VB_CHANNEL, LOC + "Opening DVB channel"); + LOG(VB_CHANNEL, LOG_INFO, "Opening DVB channel"); QMutexLocker locker(&hw_lock); @@ -194,13 +194,13 @@ bool DVBChannel::Open(DVBChannel *who) fd_frontend = open(devn.constData(), O_RDWR | O_NONBLOCK); if (fd_frontend >= 0) break; - VERBOSE(VB_IMPORTANT, LOC_WARN + - "Opening DVB frontend device failed." + ENO); + LOG(VB_GENERAL, LOG_WARNING, + "Opening DVB frontend device failed." + ENO); if (tries >= 20 || (errno != EBUSY && errno != EAGAIN)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - QString("Failed to open DVB frontend device due to " - "fatal error or too many attempts.")); + LOG(VB_GENERAL, LOG_ERR, + QString("Failed to open DVB frontend device due to " + "fatal error or too many attempts.")); return false; } usleep(50000); @@ -210,8 +210,7 @@ bool DVBChannel::Open(DVBChannel *who) memset(&info, 0, sizeof(info)); if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "Failed to get frontend information." + ENO); + LOG(VB_GENERAL, LOG_ERR, "Failed to get frontend information." + ENO); close(fd_frontend); fd_frontend = -1; @@ -231,7 +230,7 @@ bool DVBChannel::Open(DVBChannel *who) symbol_rate_minimum = info.symbol_rate_min; symbol_rate_maximum = info.symbol_rate_max; - VERBOSE(VB_RECORD, LOC + QString("Using DVB card %1, with frontend '%2'.") + LOG(VB_RECORD, LOG_INFO, QString("Using DVB card %1, with frontend '%2'.") .arg(device).arg(frontend_name)); // Turn on the power to the LNB @@ -284,9 +283,9 @@ bool DVBChannel::SwitchToInput(const QString &inputname, const QString &chan) } else { - VERBOSE(VB_IMPORTANT, - QString("DVBChannel: Could not find input: %1 on card when " - "setting channel %2\n").arg(inputname).arg(chan)); + LOG(VB_GENERAL, LOG_ERR, + QString("DVBChannel: Could not find input: %1 on card when " + "setting channel %2\n").arg(inputname).arg(chan)); } return ok; } @@ -311,9 +310,8 @@ void DVBChannel::CheckFrequency(uint64_t frequency) const (frequency_minimum <= frequency_maximum) && (frequency < frequency_minimum || frequency > frequency_maximum)) { - VERBOSE(VB_GENERAL, LOC_WARN + - QString("Your frequency setting (%1) is " - "out of range. (min/max:%2/%3)") + LOG(VB_GENERAL, LOG_WARNING, QString("Your frequency setting (%1) is " + "out of range. (min/max:%2/%3)") .arg(frequency) .arg(frequency_minimum).arg(frequency_maximum)); } @@ -324,9 +322,9 @@ void DVBChannel::CheckOptions(DTVMultiplex &tuning) const if ((tuning.inversion == DTVInversion::kInversionAuto) && !(capabilities & FE_CAN_INVERSION_AUTO)) { - VERBOSE(VB_GENERAL, LOC_WARN + - "'Auto' inversion parameter unsupported by this driver, " - "falling back to 'off'."); + LOG(VB_GENERAL, LOG_WARNING, + "'Auto' inversion parameter unsupported by this driver, " + "falling back to 'off'."); tuning.inversion = DTVInversion::kInversionOff; } @@ -340,28 +338,27 @@ void DVBChannel::CheckOptions(DTVMultiplex &tuning) const (tuning.symbolrate < symbol_rate_minimum || tuning.symbolrate > symbol_rate_maximum)) { - VERBOSE(VB_GENERAL, LOC_WARN + - QString("Symbol Rate setting (%1) is " - "out of range (min/max:%2/%3)") + LOG(VB_GENERAL, LOG_WARNING, QString("Symbol Rate setting (%1) is " + "out of range (min/max:%2/%3)") .arg(tuning.symbolrate) .arg(symbol_rate_minimum).arg(symbol_rate_maximum)); } if (tunerType.IsFECVariable() && !CheckCodeRate(tuning.fec)) { - VERBOSE(VB_GENERAL, LOC_WARN + "Selected fec_inner parameter " - "unsupported by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "Selected fec_inner parameter unsupported by this driver."); } if (tunerType.IsModulationVariable() && !CheckModulation(tuning.modulation)) { - VERBOSE(VB_GENERAL, LOC_WARN + "Selected modulation parameter unsupported " - "by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "Selected modulation parameter unsupported by this driver."); } if (DTVTunerType::kTunerTypeDVBT != tunerType) { - VERBOSE(VB_CHANNEL, LOC + tuning.toString()); + LOG(VB_CHANNEL, LOG_INFO, tuning.toString()); return; } @@ -369,53 +366,51 @@ void DVBChannel::CheckOptions(DTVMultiplex &tuning) const if (!CheckCodeRate(tuning.hp_code_rate)) { - VERBOSE(VB_GENERAL, LOC_WARN + "Selected code_rate_hp parameter " - "unsupported by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "Selected code_rate_hp parameter unsupported by this driver."); } if (!CheckCodeRate(tuning.lp_code_rate)) { - VERBOSE(VB_GENERAL, LOC_WARN + "Selected code_rate_lp parameter " - "unsupported by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "Selected code_rate_lp parameter unsupported by this driver."); } if ((tuning.bandwidth == DTVBandwidth::kBandwidthAuto) && !(capabilities & FE_CAN_BANDWIDTH_AUTO)) { - VERBOSE(VB_GENERAL, LOC_WARN + "'Auto' bandwidth parameter unsupported " - "by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "'Auto' bandwidth parameter unsupported by this driver."); } if ((tuning.trans_mode == DTVTransmitMode::kTransmissionModeAuto) && !(capabilities & FE_CAN_TRANSMISSION_MODE_AUTO)) { - VERBOSE(VB_GENERAL, LOC_WARN + - "'Auto' transmission_mode parameter unsupported " - "by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "'Auto' transmission_mode parameter unsupported by this driver."); } if ((tuning.guard_interval == DTVGuardInterval::kGuardIntervalAuto) && !(capabilities & FE_CAN_GUARD_INTERVAL_AUTO)) { - VERBOSE(VB_GENERAL, LOC_WARN + - "'Auto' guard_interval parameter unsupported " - "by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "'Auto' guard_interval parameter unsupported by this driver."); } if ((tuning.hierarchy == DTVHierarchy::kHierarchyAuto) && !(capabilities & FE_CAN_HIERARCHY_AUTO)) { - VERBOSE(VB_GENERAL, LOC_WARN + - "'Auto' hierarchy parameter unsupported by this driver. "); + LOG(VB_GENERAL, LOG_WARNING, + "'Auto' hierarchy parameter unsupported by this driver. "); } if (!CheckModulation(tuning.modulation)) { - VERBOSE(VB_GENERAL, LOC_WARN + "Selected modulation parameter unsupported " - "by this driver."); + LOG(VB_GENERAL, LOG_WARNING, + "Selected modulation parameter unsupported by this driver."); } - VERBOSE(VB_CHANNEL, LOC + tuning.toString()); + LOG(VB_CHANNEL, LOG_INFO, tuning.toString()); } /** @@ -486,7 +481,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, QString inputname) m_currentInputID : GetInputByName(inputname); if (inputid < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Tune(): Invalid input '%1'.") + LOG(VB_GENERAL, LOG_ERR, QString("Tune(): Invalid input '%1'.") .arg(inputname)); return false; } @@ -506,7 +501,8 @@ static struct dtv_properties *dtvmultiplex_to_dtvproperties( tuner_type != DTVTunerType::kTunerTypeDVBS1 && tuner_type != DTVTunerType::kTunerTypeDVBS2) { - VERBOSE(VB_IMPORTANT, "Unsupported tuner type " + tuner_type.toString()); + LOG(VB_GENERAL, LOG_ERR, + "Unsupported tuner type " + tuner_type.toString()); return NULL; } @@ -617,7 +613,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (master) { - VERBOSE(VB_CHANNEL, LOC + "tuning on slave channel"); + LOG(VB_CHANNEL, LOG_INFO, LOC + "tuning on slave channel"); SetSIStandard(tuning.sistandard); return master->Tune(tuning, inputid, force_reset, false); } @@ -628,8 +624,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (tunerType.IsDiSEqCSupported() && !diseqc_tree) { - VERBOSE(VB_IMPORTANT, LOC_ERR + - "DVB-S needs device tree for LNB handling"); + LOG(VB_GENERAL, LOG_ERR, "DVB-S needs device tree for LNB handling"); return false; } @@ -639,7 +634,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (fd_frontend < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): Card not open!"); + LOG(VB_GENERAL, LOG_ERR, "Tune(): Card not open!"); return false; } @@ -657,8 +652,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, // execute diseqc commands if (!diseqc_tree->Execute(diseqc_settings, tuning)) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " - "Failed to setup DiSEqC devices"); + LOG(VB_GENERAL, LOG_ERR, "Tune(): Failed to setup DiSEqC devices"); return false; } @@ -666,8 +660,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, DiSEqCDevLNB *lnb = diseqc_tree->FindLNB(diseqc_settings); if (!lnb) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " - "No LNB for this configuration"); + LOG(VB_GENERAL, LOG_ERR, "Tune(): No LNB for this configuration"); return false; } @@ -690,10 +683,8 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, CheckFrequency(intermediate_freq); } - VERBOSE(VB_CHANNEL, LOC + "Old Params: " + - prev_tuning.toString() + - "\n\t\t\t" + LOC + "New Params: " + - tuning.toString()); + LOG(VB_CHANNEL, LOG_INFO, LOC + "Old Params: " + prev_tuning.toString() + + "\n\t\t\t" + LOC + "New Params: " + tuning.toString()); // DVB-S is in kHz, other DVB is in Hz bool is_dvbs = ((DTVTunerType::kTunerTypeDVBS1 == tunerType) || @@ -703,7 +694,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (reset || !prev_tuning.IsEqual(tunerType, tuning, 500 * freq_mult)) { - VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") + LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Tune(): Tuning to %1%2") .arg(intermediate_freq ? intermediate_freq : tuning.frequency) .arg(suffix)); @@ -719,8 +710,8 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if ((ioctl(fd_frontend, FE_SET_PROPERTY, &cmdseq_clear)) < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + - "Clearing DTV properties cache failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, + "Tune(): Clearing DTV properties cache failed." + ENO); return false; } @@ -728,16 +719,17 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, tunerType, tuning, intermediate_freq, can_fec_auto); if (!cmds) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to convert " - "DTVMultiplex to DTV_PROPERTY sequence"); + LOG(VB_GENERAL, LOG_ERR, "Failed to convert " + "DTVMultiplex to DTV_PROPERTY sequence"); return false; } - if (VERBOSE_LEVEL_CHECK(VB_CHANNEL|VB_EXTRA)) + if (VERBOSE_LEVEL_CHECK(VB_CHANNEL) && logLevel <= LOG_DEBUG) { for (uint i = 0; i < cmds->num; i++) { - VERBOSE(VB_CHANNEL, QString("prop %1: cmd = %2, data %3") + LOG(VB_CHANNEL, LOG_DEBUG, + QString("prop %1: cmd = %2, data %3") .arg(i).arg(cmds->props[i].cmd) .arg(cmds->props[i].u.data)); } @@ -750,8 +742,8 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (res < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + - "Setting Frontend tuning parameters failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, + "Tune(): Setting Frontend tuning parameters failed." + ENO); return false; } } @@ -763,8 +755,8 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + - "Setting Frontend tuning parameters failed." + ENO); + LOG(VB_GENERAL, LOG_ERR, + "Tune(): Setting Frontend tuning parameters failed." + ENO); return false; } } @@ -781,7 +773,7 @@ bool DVBChannel::Tune(const DTVMultiplex &tuning, SetSIStandard(tuning.sistandard); - VERBOSE(VB_CHANNEL, LOC + "Tune(): Frequency tuning successful."); + LOG(VB_CHANNEL, LOG_INFO, LOC + "Tune(): Frequency tuning successful."); return true; } @@ -807,7 +799,7 @@ bool DVBChannel::IsTuningParamsProbeSupported(void) const if (fd_frontend < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Card not open!"); + LOG(VB_GENERAL, LOG_ERR, "Card not open!"); return false; } @@ -840,7 +832,7 @@ bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const if (fd_frontend < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + "Card not open!"); + LOG(VB_GENERAL, LOG_ERR, "Card not open!"); return false; } @@ -865,7 +857,7 @@ bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const dvb_frontend_parameters params; if (ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) < 0) { - VERBOSE(VB_IMPORTANT, LOC_ERR + + LOG(VB_GENERAL, LOG_ERR, "Getting Frontend tuning parameters failed." + ENO); return false; @@ -1052,7 +1044,7 @@ static bool wait_for_backend(int fd, int timeout_ms) if (-1 == ret) { - VERBOSE(VB_IMPORTANT, "dvbchannel.cpp:wait_for_backend: " + LOG(VB_GENERAL, LOG_ERR, "dvbchannel.cpp:wait_for_backend: " "Failed to wait on output" + ENO); return false; @@ -1062,13 +1054,14 @@ static bool wait_for_backend(int fd, int timeout_ms) fe_status_t status; if (ioctl(fd, FE_READ_STATUS, &status) < 0) { - VERBOSE(VB_IMPORTANT, "dvbchannel.cpp:wait_for_backend: " + LOG(VB_GENERAL, LOG_ERR, "dvbchannel.cpp:wait_for_backend: " "Failed to get status" + ENO); return false; } - VERBOSE(VB_CHANNEL, QString("dvbchannel.cpp:wait_for_backend: Status: %1") + LOG(VB_CHANNEL, LOG_INFO, + QString("dvbchannel.cpp:wait_for_backend: Status: %1") .arg(toString(status))); return true; @@ -1087,8 +1080,9 @@ static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams( if (DTVTunerType::kTunerTypeDVBS1 == tuner_type) { if (tuning.mod_sys == DTVModulationSystem::kModulationSystem_DVBS2) - VERBOSE(VB_IMPORTANT, "DVBChan Error, Tuning of a DVB-S2 transport " - "with a DVB-S card will fail."); + LOG(VB_GENERAL, LOG_ERR, + "DVBChan Error, Tuning of a DVB-S2 transport " + "with a DVB-S card will fail."); params.frequency = intermediate_freq; params.u.qpsk.symbol_rate = tuning.symbolrate; @@ -1098,7 +1092,7 @@ static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams( if (DTVTunerType::kTunerTypeDVBS2 == tuner_type) { - VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without " + LOG(VB_GENERAL, LOG_ERR, "DVBChan Error, MythTV was compiled without " "DVB-S2 headers being present so DVB-S2 tuning will fail."); }