Ticket #2426: pbb_playbackvideo_enhancements.diff

File pbb_playbackvideo_enhancements.diff, 7.3 KB (added by skamithi, 5 years ago)

allow the use of the playback-video container on a prerecorded or recording show.

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    45894589        videoOutput->ExposeEvent(); 
    45904590} 
    45914591 
     4592bool NuppelVideoPlayer::IsEmbedding(void) 
     4593{ 
     4594    if (videoOutput) 
     4595        return videoOutput->IsEmbedding(); 
     4596    return false; 
     4597} 
     4598 
    45924599void NuppelVideoPlayer::UpdateSeekAmount(bool up) 
    45934600{ 
    45944601    if (seekamountpos > 0 && !up) 
  • libs/libmythtv/tv_play.h

     
    110110    // Embedding commands for the guidegrid to use in LiveTV 
    111111    void EmbedOutput(WId wid, int x, int y, int w, int h); 
    112112    void StopEmbeddingOutput(void); 
     113    bool IsEmbedding(void); 
    113114    void EPGChannelUpdate(uint chanid, QString channum); 
    114115    
    115116    // Recording commands 
  • libs/libmythtv/NuppelVideoPlayer.h

     
    117117    void EmbedInWidget(WId wid, int x, int y, int w, int h); 
    118118    void StopEmbedding(void); 
    119119    void ExposeEvent(void); 
     120    bool IsEmbedding(void); 
    120121 
    121122    // Audio Sets 
    122123    void SetNoAudio(void)                     { no_audio_out = true; } 
  • libs/libmythtv/tv_play.cpp

     
    17851785                (gContext->GetNumSetting("EndofRecordingExitPrompt") == 1) && 
    17861786                !jumped_back && !editmode) 
    17871787            { 
    1788                 PromptDeleteRecording(tr("End Of Recording")); 
     1788                if (IsEmbedding()) 
     1789                    StopEmbeddingOutput(); 
     1790                else 
     1791                    PromptDeleteRecording(tr("End Of Recording")); 
    17891792            } 
    17901793             
    17911794                 
     
    49384941    embedWinID = 0; 
    49394942} 
    49404943 
     4944bool TV::IsEmbedding(void) 
     4945{ 
     4946    if (nvp) 
     4947        return nvp->IsEmbedding(); 
     4948    return false; 
     4949} 
     4950 
    49414951void TV::doEditSchedule(int editType) 
    49424952{ 
    49434953    if (!playbackinfo) 
     
    49654975 
    49664976    bool changeChannel = false; 
    49674977    ProgramInfo *nextProgram = NULL; 
     4978    if (!nvp) 
     4979        return; 
    49684980 
    49694981    if (StateIsLiveTV(GetState())) 
    49704982    { 
     
    50035015                    exitPlayer = true; 
    50045016                    delete nextProgram; 
    50055017                } 
    5006                 if (paused & !stayPaused) 
     5018                if (paused && !stayPaused) 
    50075019                    DoPause(false); 
    50085020                break; 
    50095021            } 
    50105022        } 
    5011         StopEmbeddingOutput(); 
     5023        if (IsEmbedding()) 
     5024            StopEmbeddingOutput(); 
    50125025    } 
    50135026    else 
    50145027    { 
     
    50205033        { 
    50215034            default: 
    50225035            case kScheduleProgramGuide: 
    5023                     RunProgramGuide(chanid, channum, true); 
    5024                     break; 
     5036                RunProgramGuide(chanid, channum, true); 
     5037                break; 
    50255038            case kScheduleProgramFinder: 
    5026                     RunProgramFind(true, false); 
    5027                     break; 
     5039                RunProgramFind(true, false); 
     5040                break; 
    50285041            case kScheduledRecording: 
    50295042            { 
    50305043                QMutexLocker locker(&pbinfoLock); 
     
    50365049            } 
    50375050            case kPlaybackBox: 
    50385051            { 
    5039                     nextProgram = RunPlaybackBoxPtr((void *)this); 
    5040                     if (nextProgram) 
     5052                long long margin =  
     5053                    (long long)(nvp->GetFrameRate() * nvp->GetAudioStretchFactor()); 
     5054                // keep video paused if only 5 seconds left in recording 
     5055                margin = margin * 5;  
     5056                QDomElement pbbxmldata; 
     5057                XMLParse *theme = new XMLParse(); 
     5058                if (theme->LoadTheme(pbbxmldata, "playback-video")) 
     5059                { 
     5060                    if (!stayPaused && paused && !nvp->IsNearEnd(margin)) 
    50415061                    { 
    5042                         setLastProgram(nextProgram); 
    5043                         jumpToProgram = true; 
    5044                         exitPlayer = true; 
    5045                         delete nextProgram; 
     5062                        DoPause(false); 
     5063                        stayPaused = true; 
    50465064                    } 
    5047                     break; 
     5065                } 
     5066                if (theme) 
     5067                    delete theme; 
     5068                nextProgram = RunPlaybackBoxPtr((void *)this); 
     5069                if (IsEmbedding()) 
     5070                    StopEmbeddingOutput(); 
     5071                if (nextProgram) 
     5072                { 
     5073                    setLastProgram(nextProgram); 
     5074                    jumpToProgram = true; 
     5075                    exitPlayer = true; 
     5076                    delete nextProgram; 
     5077                } 
     5078                break; 
    50485079            } 
    50495080        } 
    50505081 
     
    50645095    if (changeChannel) 
    50655096        EPGChannelUpdate(chanid, channum); 
    50665097 
    5067     if (jumpToProgram) 
    5068         activenvp->DiscardVideoFrames(true); 
     5098    if (nvp && jumpToProgram) 
     5099        nvp->DiscardVideoFrames(true); 
    50695100 
    50705101    menurunning = false; 
    50715102} 
  • libs/libmythtv/videooutbase.h

     
    257257    /// \brief Returns true iff we have at least the minimum number of 
    258258    ///        decoded frames ready for display. 
    259259    bool EnoughPrebufferedFrames(void) { return vbuffers.EnoughPrebufferedFrames(); } 
    260      
     260 
     261    /// \brief Returns if videooutput is embedding 
     262    bool IsEmbedding(void) { return embedding; } 
     263 
    261264    /** 
    262265     * \brief Blocks until it is possible to return a frame for decoding onto. 
    263266     * \param with_lock if true frames are properly locked, but this means you 
  • programs/mythfrontend/playbackbox.cpp

     
    330330    // theme stuff 
    331331    theme->SetWMult(wmult); 
    332332    theme->SetHMult(hmult); 
    333     if (m_player && m_player->GetState() == kState_WatchingLiveTV && 
    334         theme->LoadTheme(xmldata,"playback-video")) 
     333    if (m_player && theme->LoadTheme(xmldata,"playback-video")) 
    335334    { 
    336335        playbackVideoContainer = true; 
    337336        previewPixmapEnabled = false; 
     
    29902989                            SLOT(togglePlayListItem())); 
    29912990    } 
    29922991 
     2992    TVState m_tvstate = kState_None; 
     2993    if (m_player) 
     2994        m_tvstate = m_player->GetState(); 
     2995     
    29932996    if (program->recstatus == rsRecording && 
    2994         (!(m_player && m_player->GetState() == kState_WatchingLiveTV && 
    2995            m_player->IsSameProgram(curitem)))) 
     2997        (!(m_player &&  
     2998            (m_tvstate == kState_WatchingLiveTV ||  
     2999             m_tvstate == kState_WatchingRecording) && 
     3000            m_player->IsSameProgram(curitem)))) 
    29963001    { 
    29973002        popup->addButton(tr("Stop Recording"), this, SLOT(askStop())); 
    29983003    } 
     
    36823687 
    36833688void PlaybackBox::timeout(void) 
    36843689{ 
     3690    if (m_player && !m_player->IsEmbedding() && 
     3691        playbackVideoContainer) 
     3692    { 
     3693        exitWin(); 
     3694    } 
     3695 
    36853696    if (titleList.count() <= 1) 
    36863697        return; 
    36873698