Ticket #5570: 5570-channel-v4.patch
File 5570-channel-v4.patch, 31.6 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/firewirechannel.cpp
5 5 * Distributed as part of MythTV under GPL v2 and later. 6 6 */ 7 7 8 #include <Q3DeepCopy>9 10 8 #include "mythcontext.h" 11 9 #include "tv_rec.h" 12 10 #include "linuxfirewiredevice.h" … … 108 106 if (ok) 109 107 { 110 108 // Set the current channum to the new channel's channum 111 curchannelname = Q3DeepCopy<QString>(channum);112 (*it)->startChanNum = Q3DeepCopy<QString>(channum);109 curchannelname = channum; curchannelname.detach(); 110 (*it)->startChanNum = channum; (*it)->startChanNum.detach(); 113 111 } 114 112 115 113 VERBOSE(VB_CHANNEL, loc + " " + ((ok) ? "success" : "failure")); -
libs/libmythtv/dbchannelinfo.cpp
1 1 // -*- Mode: c++ -*- 2 2 3 3 // Qt headers 4 #include <Q3DeepCopy>5 4 #include <QFile> 6 5 7 6 // MythTV headers … … 19 18 uint _chanid, uint _major_chan, uint _minor_chan, 20 19 uint _favorite, uint _mplexid, bool _visible, 21 20 const QString &_name, const QString &_icon) : 22 channum( Q3DeepCopy<QString>(_channum)),23 callsign( Q3DeepCopy<QString>(_callsign)), chanid(_chanid),21 channum(_channum), 22 callsign(_callsign), chanid(_chanid), 24 23 major_chan(_major_chan), minor_chan(_minor_chan), 25 24 favorite(_favorite), mplexid(_mplexid), visible(_visible), 26 name( Q3DeepCopy<QString>(_name)), icon(Q3DeepCopy<QString>(_icon))25 name(_name), icon(_icon) 27 26 { 28 27 mplexid = (mplexid == 32767) ? 0 : mplexid; 29 28 icon = (icon == "none") ? QString::null : icon; 29 30 channum.detach(); 31 callsign.detach(); 32 name.detach(); 33 icon.detach(); 30 34 } 31 35 32 36 DBChannel &DBChannel::operator=(const DBChannel &other) 33 37 { 34 channum = Q3DeepCopy<QString>(other.channum);35 callsign = Q3DeepCopy<QString>(other.callsign);38 channum = other.channum; 39 callsign = other.callsign; 36 40 chanid = other.chanid; 37 41 major_chan = other.major_chan; 38 42 minor_chan = other.minor_chan; 39 43 favorite = other.favorite; 40 44 mplexid = (other.mplexid == 32767) ? 0 : other.mplexid; 41 45 visible = other.visible; 42 name = Q3DeepCopy<QString>(other.name);43 icon = Q3DeepCopy<QString>(other.icon);46 name = other.name; 47 icon = other.icon; 44 48 49 channum.detach(); 50 callsign.detach(); 51 name.detach(); 52 icon.detach(); 53 45 54 return *this; 46 55 } 47 56 … … 214 223 db_mplexid(_db_mplexid), 215 224 source_id(_source_id), 216 225 channel_id(_channel_id), 217 callsign( Q3DeepCopy<QString>(_callsign)),218 service_name( Q3DeepCopy<QString>(_service_name)),219 chan_num( Q3DeepCopy<QString>(_chan_num)),226 callsign(_callsign), 227 service_name(_service_name), 228 chan_num(_chan_num), 220 229 service_id(_service_id), 221 230 atsc_major_channel(_atsc_major_channel), 222 231 atsc_minor_channel(_atsc_minor_channel), 223 232 use_on_air_guide(_use_on_air_guide), 224 233 hidden(_hidden), 225 234 hidden_in_guide(_hidden_in_guide), 226 freqid( Q3DeepCopy<QString>(_freqid)),227 icon( Q3DeepCopy<QString>(_icon)),228 format( Q3DeepCopy<QString>(_format)),229 xmltvid( Q3DeepCopy<QString>(_xmltvid)),235 freqid(_freqid), 236 icon(_icon), 237 format(_format), 238 xmltvid(_xmltvid), 230 239 pat_tsid(_pat_tsid), 231 240 vct_tsid(_vct_tsid), 232 241 vct_chan_tsid(_vct_chan_tsid), 233 242 sdt_tsid(_sdt_tsid), 234 243 orig_netid(_orig_netid), 235 244 netid(_netid), 236 si_standard( Q3DeepCopy<QString>(_si_standard)),245 si_standard(_si_standard), 237 246 in_channels_conf(_in_channels_conf), 238 247 in_pat(_in_pat), 239 248 in_pmt(_in_pmt), … … 247 256 could_be_opencable(_could_be_opencable), 248 257 decryption_status(_decryption_status) 249 258 { 259 callsign.detach(); 260 service_name.detach(); 261 chan_num.detach(); 262 freqid.detach(); 263 icon.detach(); 264 format.detach(); 265 xmltvid.detach(); 266 si_standard.detach(); 250 267 } 251 268 252 269 ChannelInsertInfo &ChannelInsertInfo::operator=( … … 255 272 db_mplexid = other.db_mplexid; 256 273 source_id = other.source_id; 257 274 channel_id = other.channel_id; 258 callsign = Q3DeepCopy<QString>(other.callsign);259 service_name = Q3DeepCopy<QString>(other.service_name);260 chan_num = Q3DeepCopy<QString>(other.chan_num);275 callsign = other.callsign; 276 service_name = other.service_name; 277 chan_num = other.chan_num; 261 278 service_id = other.service_id; 262 279 atsc_major_channel = other.atsc_major_channel; 263 280 atsc_minor_channel = other.atsc_minor_channel; 264 281 use_on_air_guide = other.use_on_air_guide; 265 282 hidden = other.hidden; 266 283 hidden_in_guide = other.hidden_in_guide; 267 freqid = Q3DeepCopy<QString>(other.freqid);268 icon = Q3DeepCopy<QString>(other.icon);269 format = Q3DeepCopy<QString>(other.format);270 xmltvid = Q3DeepCopy<QString>(other.xmltvid);284 freqid = other.freqid; 285 icon = other.icon; 286 format = other.format; 287 xmltvid = other.xmltvid; 271 288 272 289 // non-DB info 273 290 pat_tsid = other.pat_tsid; … … 276 293 sdt_tsid = other.sdt_tsid; 277 294 orig_netid = other.orig_netid; 278 295 netid = other.netid; 279 si_standard = Q3DeepCopy<QString>(other.si_standard);296 si_standard = other.si_standard; 280 297 in_channels_conf = other.in_channels_conf; 281 298 in_pat = other.in_pat; 282 299 in_pmt = other.in_pmt; … … 290 307 could_be_opencable = other.could_be_opencable; 291 308 decryption_status = other.decryption_status; 292 309 310 callsign.detach(); 311 service_name.detach(); 312 chan_num.detach(); 313 freqid.detach(); 314 icon.detach(); 315 format.detach(); 316 xmltvid.detach(); 317 si_standard.detach(); 318 293 319 return *this; 294 320 } 295 321 -
libs/libmythtv/channelbase.h
4 4 #define CHANNELBASE_H 5 5 6 6 // Qt headers 7 #include <qmap.h> 8 #include <qstringlist.h> 7 #include <QMutex> 8 #include <QMap> 9 #include <QStringList> 9 10 10 11 // MythTV headers 11 12 #include "channelutil.h" … … 51 52 virtual uint GetNextChannel(const QString &channum, int direction) const; 52 53 virtual int GetInputByName(const QString &input) const; 53 54 virtual QString GetInputByNum(int capchannel) const; 54 virtual QString GetCurrentName(void) const 55 { return curchannelname; } 55 virtual QString GetCurrentName(void) const; 56 56 virtual int GetChanID(void) const; 57 virtual int GetCurrentInputNum(void) const 58 { return currentInputID; } 59 virtual QString GetCurrentInput(void) const 60 { return inputs[GetCurrentInputNum()]->name; } 57 virtual int GetCurrentInputNum(void) const; 58 virtual QString GetCurrentInput(void) const; 61 59 virtual int GetNextInputNum(void) const; 62 virtual QString GetNextInput(void) const 63 { return inputs[GetNextInputNum()]->name; } 64 virtual QString GetNextInputStartChan(void) 65 { return inputs[GetNextInputNum()]->startChanNum; } 66 virtual uint GetCurrentSourceID(void) const 67 { return inputs[GetCurrentInputNum()]->sourceid; } 60 virtual QString GetNextInput(void) const; 61 virtual QString GetNextInputStartChan(void); 62 virtual uint GetCurrentSourceID(void) const; 68 63 virtual uint GetInputCardID(int inputNum) const; 69 64 virtual DBChanList GetChannels(int inputNum) const; 70 65 virtual DBChanList GetChannels(const QString &inputname) const; … … 92 87 virtual bool Retune(void) { return false; } 93 88 94 89 /// Saves current channel as the default channel for the current input. 95 virtual void StoreInputChannels(void) 96 { StoreInputChannels(inputs); 97 StoreDefaultInput(GetCardID(), GetCurrentInput()); } 90 virtual void StoreInputChannels(void); 98 91 99 92 // Picture attribute settings 100 93 virtual bool InitPictureAttributes(void) { return false; } … … 119 112 static void StoreInputChannels(const InputMap&); 120 113 static void StoreDefaultInput(uint cardid, const QString &input); 121 114 115 mutable QMutex lock; 122 116 TVRec *pParent; 123 117 QString curchannelname; 124 118 int currentInputID; -
libs/libmythtv/dbox2channel.h
23 23 class DBox2Recorder; 24 24 class DBox2Channel; 25 25 class DBox2EPG; 26 class Q 3Http;26 class QHttp; 27 27 28 28 class DBox2CRelay : public QObject 29 29 { … … 83 83 bool m_recorderAlive; 84 84 DBox2Recorder *m_recorder; 85 85 86 Q 3Http *http;87 Q 3Http *httpChanger;86 QHttp *http; 87 QHttp *httpChanger; 88 88 DBox2CRelay *m_relay; 89 89 90 90 int m_dbox2channelcount; -
libs/libmythtv/hdhrchannel.cpp
335 335 return false; 336 336 337 337 // Set the current channum to the new channel's channum 338 curchannelname = Q3DeepCopy<QString>(channum); 338 curchannelname = channum; 339 curchannelname.detach(); 339 340 340 341 // Set the major and minor channel for any additional multiplex tuning 341 342 SetDTVInfo(atsc_major, atsc_minor, netid, tsid, mpeg_prog_num); 342 343 343 344 // Set this as the future start channel for this source 344 inputs[currentInputID]->startChanNum = Q3DeepCopy<QString>(curchannelname); 345 QString tmp = curchannelname; tmp.detach(); 346 inputs[currentInputID]->startChanNum = tmp; 345 347 346 348 // Turn on the HDHomeRun program filtering if it is supported 347 349 // and we are tuning to an MPEG program number. -
libs/libmythtv/channelbase.cpp
35 35 #define LOC_ERR QString("ChannelBase(%1) Error: ").arg(GetCardID()) 36 36 37 37 ChannelBase::ChannelBase(TVRec *parent) 38 : 39 pParent(parent), curchannelname(""), 40 currentInputID(-1), commfree(false), cardid(0) 38 : lock(true), pParent(parent), curchannelname(""), 39 currentInputID(-1), commfree(false), cardid(0) 41 40 { 42 41 } 43 42 … … 47 46 48 47 bool ChannelBase::Init(QString &inputname, QString &startchannel, bool setchan) 49 48 { 49 QMutexLocker locker(&lock); 50 50 51 bool ok; 51 52 52 53 if (!setchan) … … 157 158 158 159 bool ChannelBase::IsTunable(const QString &input, const QString &channum) const 159 160 { 161 QMutexLocker locker(&lock); 162 160 163 QString loc = LOC + QString("IsTunable(%1,%2)").arg(input).arg(channum); 161 164 162 165 int inputid = currentInputID; … … 221 224 222 225 uint ChannelBase::GetNextChannel(uint chanid, int direction) const 223 226 { 227 QMutexLocker locker(&lock); 228 224 229 if (!chanid) 225 230 { 226 231 InputMap::const_iterator it = inputs.find(currentInputID); … … 239 244 240 245 uint ChannelBase::GetNextChannel(const QString &channum, int direction) const 241 246 { 247 QMutexLocker locker(&lock); 248 242 249 InputMap::const_iterator it = inputs.find(currentInputID); 243 250 if (it == inputs.end()) 244 251 return 0; … … 249 256 250 257 int ChannelBase::GetNextInputNum(void) const 251 258 { 259 QMutexLocker locker(&lock); 260 252 261 // Exit early if inputs don't exist.. 253 262 if (!inputs.size()) 254 263 return -1; … … 290 299 */ 291 300 QStringList ChannelBase::GetConnectedInputs(void) const 292 301 { 302 QMutexLocker locker(&lock); 303 293 304 QStringList list; 294 305 295 306 InputMap::const_iterator it = inputs.begin(); … … 305 316 */ 306 317 QString ChannelBase::GetInputByNum(int capchannel) const 307 318 { 319 QMutexLocker locker(&lock); 320 308 321 InputMap::const_iterator it = inputs.find(capchannel); 309 322 if (it != inputs.end()) 310 323 return (*it)->name; 311 324 return QString::null; 312 325 } 313 326 327 QString ChannelBase::GetCurrentName(void) const 328 { 329 QMutexLocker locker(&lock); 330 QString ret = curchannelname; ret.detach(); 331 return ret; 332 } 333 334 int ChannelBase::GetCurrentInputNum(void) const 335 { 336 QMutexLocker locker(&lock); 337 return currentInputID; 338 } 339 340 QString ChannelBase::GetCurrentInput(void) const 341 { 342 QMutexLocker locker(&lock); 343 QString ret = inputs[GetCurrentInputNum()]->name; ret.detach(); 344 return ret; 345 } 346 347 QString ChannelBase::GetNextInput(void) const 348 { 349 QMutexLocker locker(&lock); 350 QString ret = inputs[GetNextInputNum()]->name; ret.detach(); 351 return ret; 352 } 353 354 QString ChannelBase::GetNextInputStartChan(void) 355 { 356 QMutexLocker locker(&lock); 357 QString ret = inputs[GetNextInputNum()]->startChanNum; ret.detach(); 358 return ret; 359 } 360 361 uint ChannelBase::GetCurrentSourceID(void) const 362 { 363 QMutexLocker locker(&lock); 364 return inputs[GetCurrentInputNum()]->sourceid; 365 } 366 367 void ChannelBase::StoreInputChannels(void) 368 { 369 QMutexLocker locker(&lock); 370 371 StoreInputChannels(inputs); 372 StoreDefaultInput(GetCardID(), GetCurrentInput()); 373 } 374 314 375 /** \fn ChannelBase::GetInputByName(const QString &input) const 315 376 * \brief Returns number of named input, returns -1 if not found. 316 377 */ 317 378 int ChannelBase::GetInputByName(const QString &input) const 318 379 { 380 QMutexLocker locker(&lock); 381 319 382 InputMap::const_iterator it = inputs.begin(); 320 383 for (; it != inputs.end(); ++it) 321 384 { … … 327 390 328 391 bool ChannelBase::SwitchToInput(const QString &inputname) 329 392 { 393 QMutexLocker locker(&lock); 394 330 395 int input = GetInputByName(inputname); 331 396 332 397 if (input >= 0) … … 339 404 340 405 bool ChannelBase::SwitchToInput(const QString &inputname, const QString &chan) 341 406 { 407 QMutexLocker locker(&lock); 408 342 409 int input = GetInputByName(inputname); 343 410 344 411 bool ok = false; … … 359 426 360 427 bool ChannelBase::SwitchToInput(int newInputNum, bool setstarting) 361 428 { 429 QMutexLocker locker(&lock); 430 362 431 InputMap::const_iterator it = inputs.find(newInputNum); 363 432 if (it == inputs.end() || (*it)->startChanNum.isEmpty()) 364 433 return false; … … 484 553 bool ChannelBase::IsInputAvailable( 485 554 int inputid, uint &mplexid_restriction) const 486 555 { 556 QMutexLocker locker(&lock); 557 487 558 if (inputid < 0) 488 559 return false; 489 560 … … 525 596 vector<InputInfo> ChannelBase::GetFreeInputs( 526 597 const vector<uint> &excluded_cardids) const 527 598 { 599 QMutexLocker locker(&lock); 600 528 601 vector<InputInfo> new_list; 529 602 530 603 QStringList list = GetConnectedInputs(); … … 578 651 579 652 uint ChannelBase::GetInputCardID(int inputNum) const 580 653 { 654 QMutexLocker locker(&lock); 655 581 656 InputMap::const_iterator it = inputs.find(inputNum); 582 657 if (it != inputs.end()) 583 658 return (*it)->cardid; … … 586 661 587 662 DBChanList ChannelBase::GetChannels(int inputNum) const 588 663 { 664 QMutexLocker locker(&lock); 665 589 666 int inputid = (inputNum > 0) ? inputNum : currentInputID; 590 667 591 668 DBChanList ret; … … 598 675 599 676 DBChanList ChannelBase::GetChannels(const QString &inputname) const 600 677 { 678 QMutexLocker locker(&lock); 679 601 680 int inputid = currentInputID; 602 681 if (!inputname.isEmpty()) 603 682 { … … 610 689 611 690 bool ChannelBase::ChangeExternalChannel(const QString &channum) 612 691 { 692 QMutexLocker locker(&lock); 693 613 694 #ifdef USING_MINGW 614 695 VERBOSE(VB_IMPORTANT, LOC_WARN + 615 696 QString("ChangeExternalChannel is not implemented in MinGW.")); … … 711 792 */ 712 793 int ChannelBase::GetCardID(void) const 713 794 { 795 QMutexLocker locker(&lock); 796 714 797 if (cardid > 0) 715 798 return cardid; 716 799 … … 726 809 727 810 int ChannelBase::GetChanID() const 728 811 { 812 QMutexLocker locker(&lock); 813 729 814 InputMap::const_iterator it = inputs.find(currentInputID); 730 815 if (it == inputs.end()) 731 816 return false; … … 756 841 */ 757 842 bool ChannelBase::InitializeInputs(void) 758 843 { 844 QMutexLocker locker(&lock); 845 759 846 inputs.clear(); 760 847 761 848 uint cardid = max(GetCardID(), 0); … … 838 925 const QString &oldChanNum, 839 926 const QString &newChanNum) 840 927 { 928 QMutexLocker locker(&lock); 929 841 930 InputMap::iterator it = inputs.begin(); 842 931 843 932 for (; it != inputs.end(); ++it) … … 851 940 } 852 941 853 942 if (GetCurrentSourceID() == sourceid && oldChanNum == curchannelname) 943 { 854 944 curchannelname = newChanNum; 945 curchannelname.detach(); 946 } 855 947 856 948 StoreInputChannels(inputs); 857 949 } … … 903 995 bool ChannelBase::CheckChannel(const QString &channum, 904 996 QString& inputName) const 905 997 { 998 QMutexLocker locker(&lock); 999 906 1000 inputName = ""; 907 1001 908 1002 bool ret = false; -
libs/libmythtv/dtvchannel.h
108 108 static void SaveCachedPids(int chanid, const pid_cache_t&); 109 109 110 110 protected: 111 mutable QMutex dtvinfo_lock;112 113 111 QString sistandard; ///< PSIP table standard: MPEG, DVB, ATSC, OpenCable 114 112 QString tuningMode; 115 113 int currentProgramNum; -
libs/libmythtv/channelutil.cpp
4 4 #include <set> 5 5 using namespace std; 6 6 7 #include <q3deepcopy.h>8 7 #include <qregexp.h> 9 8 #include <stdint.h> 10 9 #include <qimage.h> … … 996 995 997 996 QString ChannelUtil::GetUnknownCallsign(void) 998 997 { 999 return Q3DeepCopy<QString>(QObject::tr("UNKNOWN", "Synthesized callsign")); 998 QString ret = QObject::tr("UNKNOWN", "Synthesized callsign"); 999 ret.detach(); 1000 return ret; 1000 1001 } 1001 1002 1002 1003 int ChannelUtil::GetChanID(int mplexid, int service_transport_id, … … 1681 1682 1682 1683 while (it != list.end()) 1683 1684 { 1684 QString tmp = Q3DeepCopy<QString>(it->channum); 1685 std::pair<seen_set::iterator, bool> insret = seen.insert(tmp); 1686 if (insret.second) 1685 QString tmp = it->channum; 1686 tmp.detach(); 1687 std::pair<seen_set::iterator, bool> insert = seen.insert(tmp); 1688 if (insert.second) 1687 1689 ++it; 1688 1690 else 1689 1691 it = list.erase(it); -
libs/libmythtv/v4lchannel.cpp
46 46 currentFormat(""), is_dtv(false), 47 47 usingv4l2(false), defaultFreqTable(1) 48 48 { 49 device.detach(); 49 50 } 50 51 51 52 V4LChannel::~V4LChannel(void) 52 53 { 54 QMutexLocker locker(&lock); 53 55 Close(); 54 56 } 55 57 56 58 bool V4LChannel::Init(QString &inputname, QString &startchannel, bool setchan) 57 59 { 60 QMutexLocker locker(&lock); 61 58 62 if (setchan) 59 63 { 60 64 SetFormat(gContext->GetSetting("TVFormat")); … … 65 69 66 70 bool V4LChannel::Open(void) 67 71 { 72 QMutexLocker locker(&lock); 73 68 74 #if FAKE_VIDEO 69 75 return true; 70 76 #endif … … 99 105 100 106 void V4LChannel::Close(void) 101 107 { 108 QMutexLocker locker(&lock); 109 102 110 if (videofd >= 0) 103 111 close(videofd); 104 112 videofd = -1; … … 106 114 107 115 void V4LChannel::SetFd(int fd) 108 116 { 117 QMutexLocker locker(&lock); 118 109 119 if (fd != videofd) 110 120 Close(); 111 121 videofd = (fd >= 0) ? fd : -1; … … 269 279 */ 270 280 bool V4LChannel::InitializeInputs(void) 271 281 { 282 QMutexLocker locker(&lock); 283 272 284 // Get Inputs from DB 273 285 if (!ChannelBase::InitializeInputs()) 274 286 return false; … … 325 337 */ 326 338 void V4LChannel::SetFormat(const QString &format) 327 339 { 340 QMutexLocker locker(&lock); 341 328 342 if (!Open()) 329 343 return; 330 344 … … 346 360 if ((fmt == currentFormat) || SetInputAndFormat(inputNum, fmt)) 347 361 { 348 362 currentFormat = fmt; 363 currentFormat.detach(); 349 364 is_dtv = (fmt == "ATSC"); 350 365 } 351 366 } 352 367 353 368 int V4LChannel::SetDefaultFreqTable(const QString &name) 354 369 { 370 QMutexLocker locker(&lock); 371 355 372 defaultFreqTable = SetFreqTable(name); 356 373 return defaultFreqTable; 357 374 } 358 375 359 376 void V4LChannel::SetFreqTable(const int index) 360 377 { 378 QMutexLocker locker(&lock); 379 361 380 curList = chanlists[index].list; 362 381 totalChannels = chanlists[index].count; 363 382 } 364 383 365 384 int V4LChannel::SetFreqTable(const QString &name) 366 385 { 386 QMutexLocker locker(&lock); 387 367 388 int i = 0; 368 389 char *listname = (char *)chanlists[i].name; 369 390 … … 388 409 389 410 int V4LChannel::GetCurrentChannelNum(const QString &channame) 390 411 { 412 QMutexLocker locker(&lock); 413 391 414 for (int i = 0; i < totalChannels; i++) 392 415 { 393 416 if (channame == curList[i].name) … … 403 426 404 427 void V4LChannel::SaveCachedPids(const pid_cache_t &pid_cache) const 405 428 { 429 QMutexLocker locker(&lock); 430 406 431 int chanid = GetChanID(); 407 432 if (chanid > 0) 408 433 DTVChannel::SaveCachedPids(chanid, pid_cache); … … 410 435 411 436 void V4LChannel::GetCachedPids(pid_cache_t &pid_cache) const 412 437 { 438 QMutexLocker locker(&lock); 439 413 440 int chanid = GetChanID(); 414 441 if (chanid > 0) 415 442 DTVChannel::GetCachedPids(chanid, pid_cache); … … 417 444 418 445 bool V4LChannel::SetChannelByString(const QString &channum) 419 446 { 447 QMutexLocker locker(&lock); 448 420 449 QString loc = LOC + QString("SetChannelByString(%1)").arg(channum); 421 450 QString loc_err = loc + ", Error: "; 422 451 VERBOSE(VB_CHANNEL, loc); … … 530 559 return false; 531 560 532 561 // Set the current channum to the new channel's channum 533 curchannelname = Q3DeepCopy<QString>(channum); 562 curchannelname = channum; 563 curchannelname.detach(); 534 564 535 565 // Setup filters & recording picture attributes for framegrabing recorders 536 566 // now that the new curchannelname has been established. … … 542 572 SetDTVInfo(atsc_major, atsc_minor, netid, tsid, mpeg_prog_num); 543 573 544 574 // Set this as the future start channel for this source 545 inputs[currentInputID]->startChanNum = Q3DeepCopy<QString>(curchannelname); 575 QString tmp = curchannelname; tmp.detach(); 576 inputs[currentInputID]->startChanNum = tmp; 546 577 547 578 return true; 548 579 } 549 580 550 581 bool V4LChannel::TuneTo(const QString &channum, int finetune) 551 582 { 583 QMutexLocker locker(&lock); 584 552 585 int i = GetCurrentChannelNum(channum); 553 586 VERBOSE(VB_CHANNEL, QString("Channel(%1)::TuneTo(%2): " 554 587 "curList[%3].freq(%4)") … … 588 621 bool V4LChannel::Tune(uint frequency, QString inputname, 589 622 QString modulation, QString si_std) 590 623 { 624 QMutexLocker locker(&lock); 625 591 626 VERBOSE(VB_CHANNEL, LOC + QString("Tune(%1, %2, %3, %4)") 592 627 .arg(frequency).arg(inputname).arg(modulation).arg(si_std)); 593 628 … … 700 735 */ 701 736 bool V4LChannel::Retune(void) 702 737 { 738 QMutexLocker locker(&lock); 739 703 740 if (usingv4l2) 704 741 { 705 742 struct v4l2_frequency vf; … … 733 770 // documented in dtvchannel.h 734 771 bool V4LChannel::TuneMultiplex(uint mplexid, QString inputname) 735 772 { 773 QMutexLocker locker(&lock); 774 736 775 VERBOSE(VB_CHANNEL, LOC + QString("TuneMultiplex(%1)").arg(mplexid)); 737 776 738 777 QString modulation; … … 782 821 783 822 bool V4LChannel::SetInputAndFormat(int inputNum, QString newFmt) 784 823 { 824 QMutexLocker locker(&lock); 825 785 826 InputMap::const_iterator it = inputs.find(inputNum); 786 827 if (it == inputs.end() || (*it)->inputNumV4L < 0) 787 828 return false; … … 887 928 888 929 bool V4LChannel::SwitchToInput(int inputnum, bool setstarting) 889 930 { 931 QMutexLocker locker(&lock); 932 890 933 InputMap::const_iterator it = inputs.find(inputnum); 891 934 if (it == inputs.end()) 892 935 return false; … … 927 970 } 928 971 929 972 currentFormat = newFmt; 973 currentFormat.detach(); 930 974 is_dtv = newFmt == "ATSC"; 931 975 currentInputID = inputnum; 932 976 curchannelname = ""; // this will be set by SetChannelByString … … 986 1030 987 1031 bool V4LChannel::InitPictureAttribute(const QString db_col_name) 988 1032 { 1033 QMutexLocker locker(&lock); 1034 989 1035 if (!pParent || is_dtv) 990 1036 return false; 991 1037 … … 1093 1139 1094 1140 bool V4LChannel::InitPictureAttributes(void) 1095 1141 { 1142 QMutexLocker locker(&lock); 1143 1096 1144 return (InitPictureAttribute("brightness") && 1097 1145 InitPictureAttribute("contrast") && 1098 1146 InitPictureAttribute("colour") && … … 1101 1149 1102 1150 int V4LChannel::GetPictureAttribute(PictureAttribute attr) const 1103 1151 { 1152 QMutexLocker locker(&lock); 1153 1104 1154 QString db_col_name = toDBString(attr); 1105 1155 if (db_col_name.isEmpty()) 1106 1156 return -1; … … 1251 1301 int V4LChannel::ChangePictureAttribute( 1252 1302 PictureAdjustType type, PictureAttribute attr, bool up) 1253 1303 { 1304 QMutexLocker locker(&lock); 1305 1254 1306 if (!pParent || is_dtv) 1255 1307 return -1; 1256 1308 -
libs/libmythtv/dvbchannel.cpp
413 413 return false; 414 414 } 415 415 416 curchannelname = Q3DeepCopy<QString>(channum); 416 curchannelname = channum; 417 curchannelname.detach(); 417 418 418 419 VERBOSE(VB_CHANNEL, loc + "Tuned to frequency."); 419 420 420 421 currentInputID = nextInputID; 421 inputs[currentInputID]->startChanNum = Q3DeepCopy<QString>(curchannelname); 422 QString tmpstart = curchannelname; 423 tmpstart.detach(); 424 inputs[currentInputID]->startChanNum = tmpstart; 422 425 423 426 return true; 424 427 } … … 804 807 805 808 QString DVBChannel::GetFrontendName(void) const 806 809 { 807 return Q3DeepCopy<QString>(frontend_name); 810 QString ret = frontend_name; 811 ret.detach(); 812 return ret; 808 813 } 809 814 810 815 /** \fn DVBChannel::IsTuningParamsProbeSupported(void) const … … 875 880 } 876 881 877 882 uint mplex = tuning.mplex; 878 QString sistandard = Q3DeepCopy<QString>(tuning.sistandard);883 QString sistandard = tuning.sistandard; 879 884 880 885 tuning = dvbparams_to_dtvmultiplex(card_type, params); 881 886 -
libs/libmythtv/iptvchannel.cpp
20 20 IPTVChannel::IPTVChannel(TVRec *parent, 21 21 const QString &videodev) 22 22 : DTVChannel(parent), 23 m_videodev( Q3DeepCopy<QString>(videodev)),23 m_videodev(videodev), 24 24 m_feeder(new IPTVFeederWrapper()), 25 25 m_lock(true) 26 26 { 27 m_videodev.detach(); 27 28 VERBOSE(VB_CHANNEL, LOC + "ctor"); 28 29 } 29 30 … … 111 112 return false; 112 113 113 114 // Set the current channum to the new channel's channum 114 curchannelname = Q3DeepCopy<QString>(channum); 115 curchannelname = channum; 116 curchannelname.detach(); 115 117 116 118 // Set the dtv channel info for any additional multiplex tuning 117 119 SetDTVInfo(/*atsc_major*/ 0, /*atsc_minor*/ 0, -
libs/libmythtv/dbox2channel.cpp
9 9 using namespace std; 10 10 11 11 // Qt headers 12 #include <q3deepcopy.h> 13 #include <q3http.h> 12 #include <QHttp> 14 13 15 14 // MythTV headers 16 15 #include "mythcontext.h" … … 51 50 m_channelListReady(false), m_lastChannel("1"), 52 51 m_requestChannel(""), m_epg(new DBox2EPG()), 53 52 m_recorderAlive(false), m_recorder(NULL), 54 http(new Q 3Http()), httpChanger(new Q3Http()),53 http(new QHttp()), httpChanger(new QHttp()), 55 54 m_relay(new DBox2CRelay(this)), 56 55 m_dbox2channelcount(0) 57 56 { … … 125 124 VERBOSE(VB_CHANNEL, LOC + "Channel list not received yet. \n\t\t\t" + 126 125 QString("Will switch to channel %1 later...").arg(newChan)); 127 126 128 m_requestChannel = Q3DeepCopy<QString>(newChan); 127 m_requestChannel = newChan; 128 m_requestChannel.detach(); 129 129 return true; 130 130 } 131 131 132 QString chan = Q3DeepCopy<QString>(newChan);132 QString chan = newChan; 133 133 if (chan.isEmpty()) 134 134 { 135 135 VERBOSE(VB_CHANNEL, LOC + "Empty channel name has been provided. " … … 151 151 return false; 152 152 153 153 if (m_lastChannel != curchannelname) 154 { 154 155 m_lastChannel = curchannelname; 156 m_lastChannel.detach(); 157 } 155 158 curchannelname = chan; 159 curchannelname.detach(); 156 160 157 161 // Zap DBox2 to requested channel 158 162 // Find channel name from channel number … … 230 234 // Request Channel list via http. 231 235 // Signal will be emmitted when list is ready. 232 236 233 Q 3HttpRequestHeader header("GET", "/control/channellist");237 QHttpRequestHeader header("GET", "/control/channellist"); 234 238 header.setValue("Host", m_dbox2options->host); 235 239 http->setHost(m_dbox2options->host, m_dbox2options->httpport); 236 240 http->request(header); … … 300 304 // Request channel change via http. 301 305 // Signal will be emmited when request is done. 302 306 303 Q 3HttpRequestHeader header("GET", requestString);307 QHttpRequestHeader header("GET", requestString); 304 308 header.setValue("Host", m_dbox2options->host); 305 309 httpChanger->setHost(m_dbox2options->host, m_dbox2options->httpport); 306 310 httpChanger->request(header); -
libs/libmythtv/dtvchannel.cpp
1 1 #include "dtvchannel.h" 2 2 3 // Qt headers4 5 6 7 8 3 // MythTV headers 9 4 #include "libmythdb/mythdb.h" 10 5 #include "cardutil.h" … … 109 104 uint dvb_orig_netid, 110 105 uint mpeg_tsid, int mpeg_pnum) 111 106 { 112 QMutexLocker locker(& dtvinfo_lock);107 QMutexLocker locker(&lock); 113 108 currentProgramNum = mpeg_pnum; 114 109 currentATSCMajorChannel = atsc_major; 115 110 currentATSCMinorChannel = atsc_minor; … … 119 114 120 115 QString DTVChannel::GetSIStandard(void) const 121 116 { 122 QMutexLocker locker(&dtvinfo_lock); 123 return Q3DeepCopy<QString>(sistandard); 117 QMutexLocker locker(&lock); 118 QString ret = sistandard; ret.detach(); 119 return ret; 124 120 } 125 121 126 122 void DTVChannel::SetSIStandard(const QString &si_std) 127 123 { 128 QMutexLocker locker(&dtvinfo_lock); 129 sistandard = Q3DeepCopy<QString>(si_std.lower()); 124 QMutexLocker locker(&lock); 125 sistandard = si_std.lower(); 126 sistandard.detach(); 130 127 } 131 128 132 129 QString DTVChannel::GetSuggestedTuningMode(bool is_live_tv) const … … 140 137 141 138 bool useQuickTuning = (quickTuning && is_live_tv) || (quickTuning > 1); 142 139 143 QMutexLocker locker(& dtvinfo_lock);140 QMutexLocker locker(&lock); 144 141 if (!useQuickTuning && ((sistandard == "atsc") || (sistandard == "dvb"))) 145 return Q3DeepCopy<QString>(sistandard); 142 { 143 QString ret = sistandard; ret.detach(); 144 return ret; 145 } 146 146 147 147 return "mpeg"; 148 148 } 149 149 150 150 QString DTVChannel::GetTuningMode(void) const 151 151 { 152 QMutexLocker locker(&dtvinfo_lock); 153 return Q3DeepCopy<QString>(tuningMode); 152 QMutexLocker locker(&lock); 153 QString ret = tuningMode; ret.detach(); 154 return ret; 154 155 } 155 156 156 157 void DTVChannel::SetTuningMode(const QString &tuning_mode) 157 158 { 158 QMutexLocker locker(&dtvinfo_lock); 159 tuningMode = Q3DeepCopy<QString>(tuning_mode.lower()); 159 QMutexLocker locker(&lock); 160 tuningMode = tuning_mode.lower(); 161 tuningMode.detach(); 160 162 } 161 163 162 164 DTVChannel *DTVChannel::GetMaster(const QString &videodevice) … … 167 169 if (it != master_map.end()) 168 170 return *it; 169 171 170 master_map[Q3DeepCopy<QString>(videodevice)] = this; 172 QString tmp = videodevice; tmp.detach(); 173 master_map[tmp] = this; 171 174 172 175 return this; 173 176 } … … 180 183 if (it != master_map.end()) 181 184 return *it; 182 185 183 master_map[Q3DeepCopy<QString>(videodevice)] = (DTVChannel*) this; 186 QString tmp = videodevice; tmp.detach(); 187 master_map[tmp] = (DTVChannel*) this; 184 188 185 189 return this; 186 190 }