Ticket #3466: 3466-dbg-v1.patch
File 3466-dbg-v1.patch, 9.0 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
1475 1475 } 1476 1476 } 1477 1477 1478 void NuppelVideoPlayer::DrawUnusedRects(bool sync) 1479 { 1480 if (videoOutput) 1481 videoOutput->DrawUnusedRects(sync); 1482 } 1483 1478 1484 void NuppelVideoPlayer::ResetCaptions(uint mode_override) 1479 1485 { 1480 1486 uint origMode = textDisplayMode; -
libs/libmythtv/osdtypeteletext.h
18 18 class OSD; 19 19 class OSDType; 20 20 class OSDSurface; 21 class OSDTypeTeletext; 21 22 class TV; 22 23 23 24 class TTColor … … 106 107 int_to_page_t pages; 107 108 }; 108 109 110 class OSDUpdateLocker 111 { 112 public: 113 OSDUpdateLocker(QMutex *lock, OSDTypeTeletext *parent); 114 ~OSDUpdateLocker(void); 115 116 private: 117 QMutex *m_lock; 118 OSDTypeTeletext *m_parent; 119 }; 120 109 121 class OSDTypeTeletext : public OSDType, public TeletextViewer 110 122 { 111 123 Q_OBJECT 124 112 125 friend QColor color_tt2qt(int ttcolor); 126 friend class OSDUpdateLocker; 127 113 128 public: 114 129 OSDTypeTeletext(const QString &name, TTFFont *font, 115 130 QRect displayrect, float wmult, float hmult, OSD *osd); … … 209 224 uint8_t m_header[40]; 210 225 mutable bool m_header_changed; 211 226 mutable bool m_page_changed; 227 mutable bool m_osd_changed; 212 228 213 229 TeletextMagazine m_magazines[8]; 214 230 unsigned char m_bitswap[256]; -
libs/libmythtv/tv_play.h
112 112 void StopEmbeddingOutput(void); 113 113 bool IsEmbedding(void); 114 114 void EPGChannelUpdate(uint chanid, QString channum); 115 void DrawUnusedRects(bool sync); 115 116 116 117 // Recording commands 117 118 int PlayFromRecorder(int recordernum); -
libs/libmythtv/guidegrid.cpp
977 977 } 978 978 979 979 qApp->unlock(); 980 981 if (m_player) 982 m_player->DrawUnusedRects(false); 980 983 } 981 984 982 985 void GuideGrid::paintDate(QPainter *p) -
libs/libmythtv/NuppelVideoPlayer.h
118 118 void StopEmbedding(void); 119 119 void ExposeEvent(void); 120 120 bool IsEmbedding(void); 121 void DrawUnusedRects(bool sync); 121 122 122 123 // Audio Sets 123 124 void SetNoAudio(void) { no_audio_out = true; } -
libs/libmythtv/osdtypeteletext.cpp
68 68 69 69 m_transparent(false), m_revealHidden(false), 70 70 m_displaying(false), m_osd(osd), 71 m_header_changed(false), m_page_changed(false) 71 m_header_changed(false), m_page_changed(false), 72 m_osd_changed(false) 72 73 { 73 74 m_unbiasedrect = bias(m_displayrect, wmult, hmult); 74 75 … … 89 90 */ 90 91 void OSDTypeTeletext::Reset(void) 91 92 { 92 QMutexLocker locker(&m_lock);93 OSDUpdateLocker locker(&m_lock, this); 93 94 94 95 for (uint mag = 0; mag < 8; mag++) 95 96 { … … 129 130 const unsigned char* buf, 130 131 int vbimode, int lang, int flags) 131 132 { 132 QMutexLocker locker(&m_lock);133 OSDUpdateLocker locker(&m_lock, this); 133 134 134 135 int magazine = MAGAZINE(page); 135 136 if (magazine < 1 || magazine > 8) … … 207 208 void OSDTypeTeletext::AddTeletextData(int magazine, int row, 208 209 const unsigned char* buf, int vbimode) 209 210 { 210 QMutexLocker locker(&m_lock);211 OSDUpdateLocker locker(&m_lock, this); 211 212 212 213 int b1, b2, b3, err; 213 214 … … 322 323 return; 323 324 324 325 m_page_changed = true; 325 m_osd->UpdateTeletext(); 326 m_osd_changed = true; 327 // note: We cannot call UpdateTeletext from here since it will try to get the 328 // osdlock. The problem with this is that the OSD::Display might already 329 // be active and have called our Draw function and hence is pending the 330 // m_lock being freed. Since the OSD::Display uses the osdlock, our call 331 // to the UpdateTeletext would result in a semaphore deadlock. 332 // m_osd->UpdateTeletext(); 326 333 } 327 334 328 335 /** \fn OSDTypeTeletext::HeaderUpdated(unsigned char*,int) … … 479 486 */ 480 487 void OSDTypeTeletext::KeyPress(uint key) 481 488 { 482 QMutexLocker locker(&m_lock);489 OSDUpdateLocker locker(&m_lock, this); 483 490 484 491 int newPage = m_curpage; 485 492 int newSubPage = m_cursubpage; … … 665 672 */ 666 673 void OSDTypeTeletext::SetPage(int page, int subpage) 667 674 { 668 QMutexLocker locker(&m_lock);675 OSDUpdateLocker locker(&m_lock, this); 669 676 670 677 if (page < 0x100 || page > 0x899) 671 678 return; … … 1109 1116 1110 1117 void OSDTypeTeletext::Reinit(float wmult, float hmult) 1111 1118 { 1112 QMutexLocker locker(&m_lock);1119 OSDUpdateLocker locker(&m_lock, this); 1113 1120 1114 1121 m_displayrect = bias(m_unbiasedrect, wmult, hmult); 1115 1122 m_tt_colspace = m_displayrect.width() / kTeletextColumns; … … 1232 1239 } 1233 1240 } 1234 1241 1242 /** 1243 * \class OSDUpdateLocker 1244 * \brief Helper class to the OSDTypeTeletext 1245 * 1246 * This class is used to lock the m_lock semaphore when 1247 * there is a chance that the locked code will result in the 1248 * OSD::UpdateTeletext() function being called. It's purpose 1249 * is to lock the semaphore and once the locked code has 1250 * finished to check for a request to call OSD::UpdateTeletext(). 1251 * If required, the m_lock is released and the required call made 1252 * 1253 * This is to overcome the possible semaphore deadlock as follows: 1254 * \code 1255 * - Teletext data arrives -> locks m_lock 1256 * - While the teletext data is being processed the XMV request an 1257 * OSD update display 1258 * - The OSD update display will lock the osdlock 1259 * - The OSD update can results in the Teletext:Draw method being 1260 * called and hence the OSD update is now waiting on m_lock being 1261 * released to continue it's drawing process 1262 * - If the processing of the teletext data result in the function 1263 * OSD::UpdateTeletext being called, this function will try to 1264 * get the osdlock. 1265 * - This results in the classic semaphore deadlock and hence all 1266 * OSD update cease. 1267 * \endcode 1268 **************************************************************************/ 1269 1270 OSDUpdateLocker::OSDUpdateLocker(QMutex *lock, OSDTypeTeletext *parent) : 1271 m_lock(lock), m_parent(parent) 1272 { 1273 m_lock->lock(); 1274 } 1275 1276 OSDUpdateLocker::~OSDUpdateLocker(void) 1277 { 1278 // see if the osd has to be requested a redraw 1279 if (m_parent->m_osd_changed) 1280 { 1281 m_parent->m_osd_changed = false; 1282 m_lock->unlock(); 1283 // now it is safe to do the OSD update 1284 m_parent->m_osd->UpdateTeletext(); 1285 } 1286 else 1287 { 1288 // normal exit. Will result in the m_lock being released. 1289 m_lock->unlock(); 1290 } 1291 } 1292 -
libs/libmythtv/tv_play.cpp
5035 5035 return false; 5036 5036 } 5037 5037 5038 void TV::DrawUnusedRects(bool sync) 5039 { 5040 if (nvp) 5041 nvp->DrawUnusedRects(sync); 5042 } 5043 5038 5044 void TV::doEditSchedule(int editType) 5039 5045 { 5040 5046 if (!playbackinfo) -
libs/libmythtv/videoout_xv.cpp
2465 2465 } 2466 2466 2467 2467 if ((needrepaint || xv_need_bobdeint_repaint) && 2468 (VideoOutputSubType() >= XVideo) )2468 (VideoOutputSubType() >= XVideo) && !embedding) 2469 2469 { 2470 2470 DrawUnusedRects(/* don't do a sync*/false); 2471 2471 } … … 2480 2480 2481 2481 void VideoOutputXv::DrawUnusedRects(bool sync) 2482 2482 { 2483 // Unfortunately, this gets drawn in the wrong place on prebuffering2484 // pauses when embedding and this is rarely useful when embedding2485 // since the background is drawn in guidegrid so we bail here. -- dtk2486 if (embedding)2487 return;2488 2489 2483 // boboff assumes the smallest interlaced resolution is 480 lines - 5% 2490 2484 bool use_bob = (m_deinterlacing && m_deintfiltername == "bobdeint"); 2491 2485 int boboff_raw = (int)round(((double)display_video_rect.height()) / … … 2512 2506 2513 2507 X11L; 2514 2508 2509 unsigned long tmp_black = XJ_black; 2510 XJ_black = 0x7f007f00; 2511 2515 2512 if (xv_draw_colorkey && needrepaint) 2516 2513 { 2517 2514 XSetForeground(XJ_disp, XJ_gc, xv_colorkey); … … 2590 2587 XSync(XJ_disp, false); 2591 2588 2592 2589 X11U; 2590 2591 XJ_black = tmp_black; 2593 2592 } 2594 2593 2595 2594 /**