int eTSMPEGDecoder::setState()
{
int res = 0;
+
+ int noaudio = m_is_sm || m_is_ff || m_is_trickmode;
+
+ if ((noaudio && m_audio) || (!m_audio && !noaudio))
+ m_changed |= changeAudio;
+
#if HAVE_DVB_API_VERSION < 3
if (m_changed & changeAudio && m_audio)
m_audio->stopPid();
if (m_audio)
m_audio->stop();
m_audio = 0;
- if ((m_apid >= 0) && (m_apid < 0x1FFF))
+ if ((m_apid >= 0) && (m_apid < 0x1FFF) && !noaudio)
{
m_audio = new eDVBAudio(m_demux, 0);
if (m_audio->startPid(m_apid, m_atype))
eTSMPEGDecoder::eTSMPEGDecoder(eDVBDemux *demux, int decoder): m_demux(demux), m_changed(0)
{
demux->connectEvent(slot(*this, &eTSMPEGDecoder::demux_event), m_demux_event);
- eDebug("eTSMPEGDecoder::eTSMPEGDecoder %p", this);
+ m_is_ff = m_is_sm = m_is_trickmode = 0;
}
eTSMPEGDecoder::~eTSMPEGDecoder()
m_vpid = m_apid = m_pcrpid = pidNone;
m_changed = -1;
setState();
- eDebug("~eTSMPEGDecoder %p", this);
}
RESULT eTSMPEGDecoder::setVideoPID(int vpid)
RESULT eTSMPEGDecoder::setFastForward(int frames_to_skip)
{
+ m_is_ff = frames_to_skip != 0;
+
+ setState();
+
if (m_video)
return m_video->setFastForward(frames_to_skip);
else
RESULT eTSMPEGDecoder::setSlowMotion(int repeat)
{
+ m_is_sm = repeat != 0;
+
+ setState();
+
if (m_video)
return m_video->setSlowMotion(repeat);
else
break;
}
}
+
+RESULT eTSMPEGDecoder::setTrickmode(int what)
+{
+ m_is_trickmode = what;
+ setState();
+ return 0;
+}
changePCR = 4
};
int m_changed;
+ int m_is_ff, m_is_sm, m_is_trickmode;
int setState();
ePtr<eConnection> m_demux_event;
RESULT setSlowMotion(int repeat);
RESULT setZoom(int what);
RESULT flush();
+ RESULT setTrickmode(int what);
};
#endif
enum { zoom_Normal, zoom_PanScan, zoom_Letterbox, zoom_Fullscreen };
/** Set Zoom. mode *must* be fitting. */
virtual RESULT setZoom(int what)=0;
+
+ virtual RESULT setTrickmode(int what) = 0;
};
#endif
self.seekTimer.stop()
else:
self.seekTimer.start(500)
+
+ service = self.session.nav.getCurrentService()
+ if service is None:
+ return
+
+ seekable = service.seek()
+ if seekable is None:
+ return
+
+ if skipmode:
+ seekable.setTrickmode(1)
+ else:
+ seekable.setTrickmode(0)
+
def pauseService(self):
self.setSeekState(self.SEEK_STATE_PAUSE);
enum { dirForward = +1, dirBackward = -1 };
virtual RESULT seekRelative(int direction, pts_t to)=0;
virtual RESULT getPlayPosition(pts_t &SWIG_OUTPUT)=0;
+ /* if you want to do several seeks in a row, you can enable the trickmode.
+ audio will be switched off, sync will be disabled etc. */
+ virtual RESULT setTrickmode(int trick=0)=0;
};
TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
RESULT eDVBServicePlay::setFastForward(int ratio)
{
if (m_decoder)
- m_decoder->setFastForward(ratio);
+ return m_decoder->setFastForward(ratio);
else
return -1;
}
return pvr_channel->getCurrentPosition(demux, pos);
}
+RESULT eDVBServicePlay::setTrickmode(int trick=0)
+{
+ if (m_decoder)
+ m_decoder->setTrickmode(trick);
+ return 0;
+}
+
RESULT eDVBServicePlay::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr)
{
ptr = this;
RESULT seekTo(pts_t to);
RESULT seekRelative(int direction, pts_t to);
RESULT getPlayPosition(pts_t &pos);
+ RESULT setTrickmode(int trick=0);
// iServiceInformation
RESULT getName(std::string &name);