aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/decoder.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-12-08 00:35:27 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-12-08 00:35:27 +0000
commitcd038ce28d53719a27e7009365dd74fec19357df (patch)
tree72e33e60ba643f31897dd154daa3d3fabd0ba295 /lib/dvb/decoder.cpp
parentc72e1837b5fd6f2d0e222d7140008326fe89a58e (diff)
downloadenigma2-cd038ce28d53719a27e7009365dd74fec19357df.tar.gz
enigma2-cd038ce28d53719a27e7009365dd74fec19357df.zip
add slowmotion / fast forward
Diffstat (limited to 'lib/dvb/decoder.cpp')
-rw-r--r--lib/dvb/decoder.cpp43
1 files changed, 39 insertions, 4 deletions
diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp
index 835f434e..6794a056 100644
--- a/lib/dvb/decoder.cpp
+++ b/lib/dvb/decoder.cpp
@@ -125,7 +125,7 @@ void eDVBAudio::freeze()
if (::ioctl(m_fd, AUDIO_PAUSE) < 0)
eDebug("video: AUDIO_PAUSE: %m");
}
-
+
void eDVBAudio::unfreeze()
{
if (::ioctl(m_fd, AUDIO_CONTINUE) < 0)
@@ -191,12 +191,13 @@ int eDVBVideo::startPid(int pid)
void eDVBVideo::stop()
{
- if (::ioctl(m_fd, VIDEO_STOP, 1) < 0)
- eWarning("video: VIDEO_STOP: %m");
#if HAVE_DVB_API_VERSION > 2
if (::ioctl(m_fd_demux, DMX_STOP) < 0)
eWarning("video: DMX_STOP: %m");
#endif
+ eDebug("VIDEO_STOP");
+ if (::ioctl(m_fd, VIDEO_STOP, 1) < 0)
+ eWarning("video: VIDEO_STOP: %m");
}
#if HAVE_DVB_API_VERSION < 3
@@ -225,8 +226,24 @@ void eDVBVideo::unfreeze()
eDebug("video: VIDEO_CONTINUE: %m");
}
+int eDVBVideo::setSlowMotion(int repeat)
+{
+ m_is_slow_motion = repeat;
+ return ::ioctl(m_fd, VIDEO_SLOWMOTION, repeat);
+}
+
+int eDVBVideo::setFastForward(int skip)
+{
+ m_is_fast_forward = skip;
+ return ::ioctl(m_fd, VIDEO_FAST_FORWARD, skip);
+}
+
eDVBVideo::~eDVBVideo()
{
+ if (m_is_slow_motion)
+ setSlowMotion(0);
+ if (m_is_fast_forward)
+ setFastForward(0);
if (m_fd >= 0)
::close(m_fd);
if (m_fd_demux >= 0)
@@ -342,11 +359,16 @@ int eTSMPEGDecoder::setState()
#else
if (m_changed & changeVideo)
{
+ eDebug("VIDEO CHANGED (to %04x)", m_vpid);
if (m_video)
+ {
+ eDebug("STOP");
m_video->stop();
+ }
m_video = 0;
if ((m_vpid >= 0) && (m_vpid < 0x1FFF))
{
+ eDebug("new video");
m_video = new eDVBVideo(m_demux, 0);
if (m_video->startPid(m_vpid))
{
@@ -395,6 +417,7 @@ int eTSMPEGDecoder::setState()
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);
}
eTSMPEGDecoder::~eTSMPEGDecoder()
@@ -402,6 +425,7 @@ eTSMPEGDecoder::~eTSMPEGDecoder()
m_vpid = m_apid = m_pcrpid = pidNone;
m_changed = -1;
setState();
+ eDebug("~eTSMPEGDecoder %p", this);
}
RESULT eTSMPEGDecoder::setVideoPID(int vpid)
@@ -477,9 +501,20 @@ RESULT eTSMPEGDecoder::setPictureSkipMode(int what)
return -1;
}
+RESULT eTSMPEGDecoder::setFastForward(int frames_to_skip)
+{
+ if (m_video)
+ return m_video->setFastForward(frames_to_skip);
+ else
+ return -1;
+}
+
RESULT eTSMPEGDecoder::setSlowMotion(int repeat)
{
- return -1;
+ if (m_video)
+ return m_video->setSlowMotion(repeat);
+ else
+ return -1;
}
RESULT eTSMPEGDecoder::setZoom(int what)