Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: PATCHES: vdr-1.2.6 (getSTC and mp2)
> > The GetSTC() thing might be an exception, if and only if it gets
> > rid of the AddPid() call and does this by using a separate file
> > handle (let's call it fd_stc), which, as far as I understand this,
> > just needs to be opened on the demux device and doesn't require
> > any special PID to be set on.
> >
>
> so .. do i ? or do you ?
>
> till when .. ? within this weekend is ok ?
Here's what I'll be willing to add for version 1.2.6.
Note that cDevice::GetSTC() returns the STC value as
a (signed) int64_t and uses -1 to indicate an error
condition.
Line numbers may be slightly off since I have already
changed a few other things for 1.2.6pre4.
Please test this and let me know whether it works for you,
so I can include it into 1.2.6pre4.
Klaus
===================================================================
RCS file: ./RCS/device.c
retrieving revision 1.47
diff -u -r1.47 ./device.c
--- ./device.c 2003/08/15 12:34:36 1.47
+++ ./device.c 2003/11/07 13:16:12
@@ -498,6 +498,11 @@
return false;
}
+int64_t cDevice::GetSTC(void)
+{
+ return -1;
+}
+
void cDevice::TrickSpeed(int Speed)
{
}
===================================================================
RCS file: ./RCS/device.h
retrieving revision 1.34
diff -u -r1.34 ./device.h
--- ./device.h 2003/08/15 13:05:50 1.34
+++ ./device.h 2003/11/07 13:15:45
@@ -320,6 +320,10 @@
///< Sets the device into the given play mode.
///< \return true if the operation was successful.
public:
+ virtual int64_t GetSTC(void);
+ ///< Gets the current System Time Counter, which can be used to
+ ///< synchronize audio and video. If this device is unable to
+ ///< provide the STC, -1 will be returned.
virtual void TrickSpeed(int Speed);
///< Sets the device into a mode where replay is done slower.
///< Every single frame shall then be displayed the given number of
===================================================================
RCS file: ./RCS/dvbdevice.c
retrieving revision 1.67.1.2
diff -u -r1.67.1.2 ./dvbdevice.c
--- ./dvbdevice.c 2003/10/24 14:32:20 1.67.1.2
+++ ./dvbdevice.c 2003/11/07 13:24:49
@@ -326,6 +326,7 @@
fd_osd = DvbOpen(DEV_DVB_OSD, n, O_RDWR);
fd_video = DvbOpen(DEV_DVB_VIDEO, n, O_RDWR | O_NONBLOCK);
fd_audio = DvbOpen(DEV_DVB_AUDIO, n, O_RDWR | O_NONBLOCK);
+ fd_stc = DvbOpen(DEV_DVB_DEMUX, n, O_RDWR);
// The DVR device (will be opened and closed as needed):
@@ -867,6 +868,20 @@
}
playMode = PlayMode;
return true;
+}
+
+int64_t cDvbDevice::GetSTC(void)
+{
+ if (fd_stc >= 0) {
+ struct dmx_stc stc;
+ stc.num = 0;
+ if (ioctl(fd_stc, DMX_GET_STC, &stc) == -1) {
+ esyslog("ERROR: stc %d: %m", CardIndex() + 1);
+ return -1;
+ }
+ return stc.stc / stc.base;
+ }
+ return -1;
}
void cDvbDevice::TrickSpeed(int Speed)
===================================================================
RCS file: ./RCS/dvbdevice.h
retrieving revision 1.23
diff -u -r1.23 ./dvbdevice.h
--- ./dvbdevice.h 2003/10/04 11:54:50 1.23
+++ ./dvbdevice.h 2003/11/07 13:17:13
@@ -38,7 +38,7 @@
///< \return True if any devices are available.
private:
fe_type_t frontendType;
- int fd_osd, fd_audio, fd_video, fd_dvr;
+ int fd_osd, fd_audio, fd_video, fd_dvr, fd_stc;
int OsdDeviceHandle(void) const { return fd_osd; }
protected:
virtual void MakePrimaryDevice(bool On);
@@ -107,6 +107,7 @@
virtual bool CanReplay(void) const;
virtual bool SetPlayMode(ePlayMode PlayMode);
public:
+ virtual int64_t GetSTC(void);
virtual void TrickSpeed(int Speed);
virtual void Clear(void);
virtual void Play(void);
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.
Home |
Main Index |
Thread Index