Example #1
0
void BDRingBuffer::HandleBDEvent(BD_EVENT &ev)
{
    switch (ev.event) {
        case BD_EVENT_NONE:
            break;
        case BD_EVENT_ERROR:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_ERROR %1").arg(ev.param));
            break;
        case BD_EVENT_ENCRYPTED:
            VERBOSE(VB_IMPORTANT, LOC +
                    QString("EVENT_ENCRYPTED, playback will fail."));
            break;

        /* current playback position */

        case BD_EVENT_ANGLE:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_ANGLE %1").arg(ev.param));
            m_currentAngle = ev.param;
            break;
        case BD_EVENT_TITLE:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_TITLE %1 (old %2)")
                                .arg(ev.param).arg(m_currentTitle));
            m_currentTitle = ev.param;
            break;
        case BD_EVENT_END_OF_TITLE:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_END_OF_TITLE %1")
                                .arg(m_currentTitle));
            WaitForPlayer();
            break;
        case BD_EVENT_PLAYLIST:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_PLAYLIST %1 (old %2)")
                                .arg(ev.param).arg(m_currentPlaylist));
            m_currentPlaylist = ev.param;
            m_currentTitle = bd_get_current_title(bdnav);
            SwitchPlaylist(m_currentPlaylist);
            break;
        case BD_EVENT_PLAYITEM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_PLAYITEM %1")
                                .arg(ev.param));
            m_currentPlayitem = ev.param;
            break;
        case BD_EVENT_CHAPTER:
            // N.B. event chapter numbering 1...N, chapter seeks etc 0...
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_CHAPTER %1")
                                .arg(ev.param));
            m_currentChapter = ev.param;
            break;
        case BD_EVENT_STILL:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_STILL %1").arg(ev.param));
            break;
        case BD_EVENT_STILL_TIME:
            // we use the clip information to determine the still frame status
            // sleep a little
            usleep(10000);
            break;
        case BD_EVENT_SEEK:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SEEK"));
            break;

        /* stream selection */

        case BD_EVENT_AUDIO_STREAM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_AUDIO_STREAM %1")
                                .arg(ev.param));
            m_currentAudioStream = ev.param;
            break;
        case BD_EVENT_IG_STREAM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_IG_STREAM %1")
                                .arg(ev.param));
            m_currentIGStream = ev.param;
            break;
        case BD_EVENT_PG_TEXTST_STREAM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_PG_TEXTST_STREAM %1")
                                .arg(ev.param));
            m_currentPGTextSTStream = ev.param;
            break;
        case BD_EVENT_SECONDARY_AUDIO_STREAM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SECONDARY_AUDIO_STREAM %1")
                                .arg(ev.param));
            m_currentSecondaryAudioStream = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO_STREAM:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SECONDARY_VIDEO_STREAM %1")
                                .arg(ev.param));
            m_currentSecondaryVideoStream = ev.param;
            break;

        case BD_EVENT_PG_TEXTST:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_PG_TEXTST %1")
                                .arg(ev.param ? "enable" : "disable"));
            m_PGTextSTEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_AUDIO:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SECONDARY_AUDIO %1")
                                .arg(ev.param ? "enable" : "disable"));
            m_secondaryAudioEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SECONDARY_VIDEO %1")
                                .arg(ev.param ? "enable" : "disable"));
            m_secondaryVideoEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO_SIZE:
            VERBOSE(VB_PLAYBACK, LOC + QString("EVENT_SECONDARY_VIDEO_SIZE %1")
                                .arg(ev.param==0 ? "PIP" : "fullscreen"));
            m_secondaryVideoIsFullscreen = ev.param;
            break;

        default:
            VERBOSE(VB_PLAYBACK, LOC_ERR + QString("Unknown Event! %1 %2")
                                .arg(ev.event).arg(ev.param));
          break;
      }
}
Example #2
0
void BDRingBuffer::HandleBDEvent(BD_EVENT &ev)
{
    switch (ev.event) {
        case BD_EVENT_NONE:
            break;
        case BD_EVENT_ERROR:
            VERBOSE(VB_PLAYBACK,
                    QString("BDRingBuf: EVENT_ERROR %1").arg(ev.param));
            break;
        case BD_EVENT_ENCRYPTED:
            VERBOSE(VB_IMPORTANT,
                    QString("BDRingBuf: EVENT_ENCRYPTED, playback will fail."));
            break;

        /* current playback position */

        case BD_EVENT_ANGLE:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_ANGLE %1").arg(ev.param));
            m_currentAngle = ev.param;
            break;
        case BD_EVENT_TITLE:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_TITLE %1").arg(ev.param));
            break;
        case BD_EVENT_END_OF_TITLE:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_END_OF_TITLE"));
            // TODO: Signal the player to flush buffers before reading further.
            break;
        case BD_EVENT_PLAYLIST:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_PLAYLIST %1").arg(ev.param));
            m_currentPlaylist = ev.param;
            m_currentTitle = bd_get_current_title(bdnav);
            SwitchPlaylist(m_currentPlaylist);
            break;
        case BD_EVENT_PLAYITEM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_PLAYITEM %1").arg(ev.param));
            m_currentPlayitem = ev.param;
            break;
        case BD_EVENT_CHAPTER:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_CHAPTER %1").arg(ev.param));
            m_currentChapter = ev.param;
            break;
        case BD_EVENT_STILL:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_STILL %1").arg(ev.param));
            m_still = ev.param;
            break;
        case BD_EVENT_STILL_TIME:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_STILL_TIME %1").arg(ev.param));
            // TODO: Handle still playback.  0 = infinite, 1-300 = seconds.
            break;
        case BD_EVENT_SEEK:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SEEK"));
            break;

        /* stream selection */

        case BD_EVENT_AUDIO_STREAM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_AUDIO_STREAM %1").arg(ev.param));
            m_currentAudioStream = ev.param;
            break;
        case BD_EVENT_IG_STREAM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_IG_STREAM %1").arg(ev.param));
            m_currentIGStream = ev.param;
            break;
        case BD_EVENT_PG_TEXTST_STREAM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_PG_TEXTST_STREAM %1").arg(ev.param));
            m_currentPGTextSTStream = ev.param;
            break;
        case BD_EVENT_SECONDARY_AUDIO_STREAM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SECONDARY_AUDIO_STREAM %1").arg(ev.param));
            m_currentSecondaryAudioStream = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO_STREAM:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SECONDARY_VIDEO_STREAM %1").arg(ev.param));
            m_currentSecondaryVideoStream = ev.param;
            break;

        case BD_EVENT_PG_TEXTST:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_PG_TEXTST %1").arg(ev.param ? "enable" : "disable"));
            m_PGTextSTEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_AUDIO:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SECONDARY_AUDIO %1").arg(ev.param ? "enable" : "disable"));
            m_secondaryAudioEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SECONDARY_VIDEO %1").arg(ev.param ? "enable" : "disable"));
            m_secondaryVideoEnabled = ev.param;
            break;
        case BD_EVENT_SECONDARY_VIDEO_SIZE:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: EVENT_SECONDARY_VIDEO_SIZE %1").arg(ev.param==0 ? "PIP" : "fullscreen"));
            m_secondaryVideoIsFullscreen = ev.param;
            break;

        default:
            VERBOSE(VB_PLAYBACK|VB_EXTRA,
                    QString("BDRingBuf: Unknown Event! %1 %2").arg(ev.event).arg(ev.param));
          break;
      }
}