Ticket #4070: 4070-v1.patch
File 4070-v1.patch, 9.2 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
215 215 yuv_scaler(NULL), yuv_frame_scaled(NULL), 216 216 yuv_scaler_in_size(0,0), yuv_scaler_out_size(0,0), 217 217 // Filters 218 videoFilter List(""),218 videoFiltersForProgram(""), videoFiltersOverride(""), 219 219 postfilt_width(0), postfilt_height(0), 220 220 videoFilters(NULL), FiltMan(new FilterManager()), 221 221 // Commercial filtering … … 264 264 vbimode = VBIMode::Parse(gContext->GetSetting("VbiFormat")); 265 265 266 266 if (info) 267 { 268 m_playbackinfo = new ProgramInfo(*info); 269 m_playbackinfo->MarkAsInUse(true, m_recusage); 270 } 267 SetPlaybackInfo(new ProgramInfo(*info)); 271 268 272 269 commrewindamount = gContext->GetNumSetting("CommRewindAmount",0); 273 270 commnotifyamount = gContext->GetNumSetting("CommNotifyAmount",0); … … 296 293 if (audioOutput) 297 294 delete audioOutput; 298 295 299 if (m_playbackinfo) 300 { 301 m_playbackinfo->MarkAsInUse(false); 302 delete m_playbackinfo; 303 } 296 SetPlaybackInfo(NULL); 304 297 305 298 if (weMadeBuffer) 306 299 delete ringBuffer; … … 506 499 return video_actually_paused; 507 500 } 508 501 502 void NuppelVideoPlayer::SetPlaybackInfo(ProgramInfo *pginfo) 503 { 504 if (m_playbackinfo) 505 { 506 m_playbackinfo->MarkAsInUse(false); 507 delete m_playbackinfo; 508 videoFiltersForProgram = QString::null; 509 } 510 511 m_playbackinfo = pginfo; 512 513 if (m_playbackinfo) 514 { 515 m_playbackinfo->MarkAsInUse(true, m_recusage); 516 videoFiltersForProgram = 517 QDeepCopy<QString>(m_playbackinfo->chanOutputFilters); 518 } 519 } 520 509 521 void NuppelVideoPlayer::SetPrebuffering(bool prebuffer) 510 522 { 511 523 prebuffering_lock.lock(); … … 529 541 530 542 bool NuppelVideoPlayer::InitVideo(void) 531 543 { 532 InitFilters();533 544 if (using_null_videoout) 534 545 { 535 546 videoOutput = new VideoOutputNull(); … … 610 621 611 622 SetCaptionsEnabled(gContext->GetNumSetting("DefaultCCMode"), false); 612 623 624 InitFilters(); 625 613 626 return true; 614 627 } 615 628 … … 633 646 634 647 void NuppelVideoPlayer::ReinitVideo(void) 635 648 { 636 InitFilters();637 638 649 vidExitLock.lock(); 639 650 videofiltersLock.lock(); 640 651 … … 676 687 DisableCaptions(textDisplayMode, false); 677 688 SetCaptionsEnabled(true, false); 678 689 } 690 691 InitFilters(); 679 692 } 680 693 681 694 QString NuppelVideoPlayer::ReinitAudio(void) … … 1118 1131 VideoFrameType otmp = FMT_YV12; 1119 1132 int btmp; 1120 1133 1134 QString filters = ""; 1135 if (videoOutput) 1136 filters = videoOutput->GetFilters(); 1137 1138 if (!videoFiltersForProgram.isEmpty()) 1139 { 1140 if (videoFiltersForProgram[0] != '+') 1141 { 1142 filters = QDeepCopy<QString>(videoFiltersForProgram); 1143 } 1144 else 1145 { 1146 if ((filters.length() > 1) && (filters.right(1) != ",")) 1147 filters += ","; 1148 filters += QDeepCopy<QString>(videoFiltersForProgram.mid(1)); 1149 } 1150 } 1151 1152 if (!videoFiltersOverride.isEmpty()) 1153 filters = QDeepCopy<QString>(videoFiltersOverride); 1154 1121 1155 videofiltersLock.lock(); 1122 1156 1123 1157 if (videoFilters) … … 1125 1159 1126 1160 postfilt_width = video_width; 1127 1161 postfilt_height = video_height; 1128 videoFilters = FiltMan->LoadFilters( videoFilterList, itmp, otmp,1162 videoFilters = FiltMan->LoadFilters(filters, itmp, otmp, 1129 1163 postfilt_width, postfilt_height, btmp); 1130 1164 1165 VERBOSE(VB_PLAYBACK, LOC + QString("LoadFilters('%1'..) -> ") 1166 .arg(filters)<<videoFilters); 1167 1131 1168 videofiltersLock.unlock(); 1132 1169 } 1133 1170 … … 2877 2914 2878 2915 bool newIsDummy = livetvchain->GetCardType(newid) == "DUMMY"; 2879 2916 2880 if (m_playbackinfo) 2881 { 2882 m_playbackinfo->MarkAsInUse(false); 2883 delete m_playbackinfo; 2884 } 2917 SetPlaybackInfo(pginfo); 2885 2918 2886 m_playbackinfo = pginfo;2887 m_playbackinfo->MarkAsInUse(true, m_recusage);2888 2889 2919 ringBuffer->Pause(); 2890 2920 ringBuffer->WaitForPause(); 2891 2921 … … 2996 3026 long long nextpos = livetvchain->GetJumpPos(); 2997 3027 bool newIsDummy = livetvchain->GetCardType(newid) == "DUMMY"; 2998 3028 2999 if (m_playbackinfo) 3000 { 3001 m_playbackinfo->MarkAsInUse(false); 3002 delete m_playbackinfo; 3003 } 3029 SetPlaybackInfo(pginfo); 3004 3030 3005 m_playbackinfo = pginfo;3006 m_playbackinfo->MarkAsInUse(true, m_recusage);3007 3008 3031 ringBuffer->Pause(); 3009 3032 ringBuffer->WaitForPause(); 3010 3033 -
libs/libmythtv/tv_play.h
229 229 void StartOSD(void); 230 230 void StopStuff(bool stopRingbuffers, bool stopPlayers, bool stopRecorders); 231 231 232 QString GetFiltersForChannel(void);233 234 232 void ToggleChannelFavorite(void); 235 233 void ChangeChannel(int direction); 236 234 void ChangeChannel(uint chanid, const QString &channum); -
libs/libmythtv/NuppelVideoPlayer.h
139 139 void SetRingBuffer(RingBuffer *rbuf) { ringBuffer = rbuf; } 140 140 void SetLiveTVChain(LiveTVChain *tvchain) { livetvchain = tvchain; } 141 141 void SetLength(int len) { totalLength = len; } 142 void SetVideoFilters(QString &filters) { videoFilterList = filters; } 142 void SetVideoFilters(const QString &override) 143 { videoFiltersOverride = QDeepCopy<QString>(override); } 143 144 void SetFramesPlayed(long long played) { framesPlayed = played; } 144 145 void SetEof(void) { eof = true; } 145 146 void SetPipPlayer(NuppelVideoPlayer *pip) … … 414 415 void AutoDeint(VideoFrame*); 415 416 416 417 // Private Sets 418 void SetPlaybackInfo(ProgramInfo *pginfo); 417 419 void SetPrebuffering(bool prebuffer); 418 420 419 421 // Private Gets … … 702 704 703 705 // Filters 704 706 QMutex videofiltersLock; 705 QString videoFilterList; 707 QString videoFiltersForProgram; 708 QString videoFiltersOverride; 706 709 int postfilt_width; ///< Post-Filter (output) width 707 710 int postfilt_height; ///< Post-Filter (output) height 708 711 FilterChain *videoFilters; -
libs/libmythtv/tv_play.cpp
1514 1514 return; 1515 1515 } 1516 1516 1517 QString filters = "";1518 1519 1520 1517 nvp = new NuppelVideoPlayer("player", playbackinfo); 1521 1518 nvp->SetParentWidget(myWindow); 1522 1519 nvp->SetParentPlayer(this); … … 1533 1530 1534 1531 nvp->SetAudioStretchFactor(normal_speed); 1535 1532 1536 filters = GetFiltersForChannel();1537 nvp->SetVideoFilters(filters);1538 1539 1533 if (embedWinID > 0) 1540 1534 nvp->EmbedInWidget(embedWinID, embedBounds.x(), embedBounds.y(), 1541 1535 embedBounds.width(), embedBounds.height()); … … 1550 1544 udpnotify = NULL; 1551 1545 } 1552 1546 1553 1554 QString TV::GetFiltersForChannel()1555 {1556 QString filters;1557 QString chanFilters;1558 1559 QString chan_name;1560 1561 pbinfoLock.lock();1562 if (playbackinfo) // Recordings have this info already.1563 chanFilters = playbackinfo->chanOutputFilters;1564 pbinfoLock.unlock();1565 1566 if ((chanFilters.length() > 1) && (chanFilters[0] != '+'))1567 {1568 filters = chanFilters;1569 }1570 else1571 {1572 filters = baseFilters;1573 1574 if ((filters.length() > 1) && (filters.right(1) != ","))1575 filters += ",";1576 1577 filters += chanFilters.mid(1);1578 }1579 1580 VERBOSE(VB_CHANNEL, LOC +1581 QString("Output filters for this channel are: '%1'").arg(filters));1582 return filters;1583 }1584 1585 1547 void TV::SetupPipPlayer(void) 1586 1548 { 1587 1549 if (pipnvp) … … 7375 7337 7376 7338 chain->JumpTo(-1, 1); 7377 7339 7378 QString filters = GetFiltersForChannel();7379 activenvp->SetVideoFilters(filters);7380 7340 activenvp->Play(normal_speed, true, false); 7381 7341 activerbuffer->IgnoreLiveEOF(false); 7382 7342 } -
libs/libmythtv/videooutbase.cpp
367 367 osd->DisableFade(); 368 368 } 369 369 370 QString VideoOutput::GetFilters(void) const 371 { 372 return db_vdisp_profile->GetFilters(); 373 } 374 370 375 void VideoOutput::SetVideoFrameRate(float playback_fps) 371 376 { 372 377 db_vdisp_profile->SetOutput(playback_fps); -
libs/libmythtv/videooutbase.h
207 207 208 208 /// \brief returns QRect of PIP based on PIPLocation 209 209 virtual QRect GetPIPRect(int location, NuppelVideoPlayer *pipplayer = NULL); 210 211 QString GetFilters(void) const; 212 210 213 protected: 211 214 void InitBuffers(int numdecode, bool extra_for_pause, int need_free, 212 215 int needprebuffer_normal, int needprebuffer_small,