diff options
author | phintuka <phintuka> | 2013-08-21 09:14:36 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2013-08-21 09:14:36 +0000 |
commit | 93a3128953313254cc82e58dc15715f1bcdebbe2 (patch) | |
tree | 92b9a7cee6848d955c8e42c48d3a4620e4f53c36 | |
parent | d7d9bf9acfed8076fcd3c2dd1abb449000065cbb (diff) | |
download | xineliboutput-93a3128953313254cc82e58dc15715f1bcdebbe2.tar.gz xineliboutput-93a3128953313254cc82e58dc15715f1bcdebbe2.tar.bz2 |
Removed old compability stuff (vdr-1.7.33 is required)
-rw-r--r-- | device.c | 202 | ||||
-rw-r--r-- | device.h | 14 | ||||
-rw-r--r-- | osd.c | 37 | ||||
-rw-r--r-- | xineliboutput.c | 6 |
4 files changed, 16 insertions, 243 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.125 2013-08-20 09:33:43 phintuka Exp $ + * $Id: device.c,v 1.126 2013-08-21 09:14:36 phintuka Exp $ * */ @@ -47,10 +47,6 @@ #define LOCAL_INIT_TIMEOUT 20 // seconds #define SERVER_INIT_TIMEOUT 5 // seconds -#if (VDRVERSNUM > 10700) && (VDRVERSNUM < 10711) -# error VDR versions 1.7.1 ... 1.7.10 are not supported ! -#endif - #ifdef LOG_TRICKSPEED # define LOGTRICKSPEED(x...) LOGMSG("trs: " x) #else @@ -77,12 +73,8 @@ class cXinelibStatusMonitor : public cStatus }; protected: -#if VDRVERSNUM < 10726 - virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber); -#else virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView); -#endif - virtual void Replaying(const cControl *Control, const char *Name, + virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On); cXinelibDevice& m_Device; @@ -115,12 +107,8 @@ class cXinelibStatusMonitor : public cStatus #endif }; -void cXinelibStatusMonitor::ChannelSwitch(const cDevice *Device, -#if VDRVERSNUM < 10726 - int ChannelNumber) -#else - int ChannelNumber, bool LiveView) -#endif +void cXinelibStatusMonitor::ChannelSwitch(const cDevice *Device, + int ChannelNumber, bool LiveView) { TRACEF("cXinelibStatusMonitor::ChannelSwitch"); TRACK_TIME(200); @@ -208,10 +196,6 @@ cXinelibDevice::cXinelibDevice() m_liveMode = true; m_TrickSpeed = -1; m_TrickSpeedMode = 0; -#if VDRVERSNUM < 10705 - m_TrickSpeedPts = 0; - m_TrickSpeedDelay = 0; -#endif m_SkipAudio = false; m_PlayingFile = pmNone; m_StreamStart = true; @@ -691,12 +675,7 @@ bool cXinelibDevice::SetPlayMode(ePlayMode PlayMode) #define trs_IPB_frames 0x01 // stream has all frame types #define trs_I_frames 0x02 // stream has only I-frames #define trs_NoAudio 0x08 // no audio in trick speed mode -#if VDRVERSNUM < 10705 -#define trs_PTS_recalc 0x10 // PTS must be re-calculated -#define trs_PTS_check 0x20 // detect in PlayVideo if PTS must be recalculated -#else #define trs_Backward 0x40 // palying backwards -- same as regen pts ??? -#endif void cXinelibDevice::TrickSpeed(int Speed) { @@ -707,10 +686,6 @@ void cXinelibDevice::TrickSpeed(int Speed) LOGTRICKSPEED("TrickSpeed changed from %d to %d [%d]", m_TrickSpeed, Speed, RealSpeed); m_TrickSpeed = Speed; -#if VDRVERSNUM < 10705 - m_TrickSpeedPts = 0; - m_TrickSpeedDelay = 0; -#endif // Possible transitions: // fast <-> play @@ -741,16 +716,8 @@ void cXinelibDevice::TrickSpeed(int Speed) // ForEach(m_clients, &cXinelibThread::Clear); //} -#if VDRVERSNUM < 10705 - // only I-frames, backwards, pts must be re-generated - m_TrickSpeedMode = trs_I_frames | trs_PTS_recalc | trs_NoAudio; - - // change decoder and UDP/RTP scheduler clock rates - ForEach(m_clients, &cXinelibThread::TrickSpeed, RealSpeed); -#else m_TrickSpeedMode = trs_I_frames | trs_Backward | trs_NoAudio; ForEach(m_clients, &cXinelibThread::TrickSpeed, RealSpeed, true); -#endif } else if(Speed == 6 || Speed == 3 || Speed == 1) { @@ -766,17 +733,6 @@ void cXinelibDevice::TrickSpeed(int Speed) LOGTRICKSPEED(" Trick speed limited to %dx speed", RealSpeed); } -#if VDRVERSNUM < 10705 - /* only I-frames, backwards, pts must be re-generated if playing backwards */ - m_TrickSpeedMode |= trs_PTS_check; - - /* backward/forward state is unknown until first PTS is seen - so, clear() must be done in PlayVideo. */ - /* previous trick speed state is not overwritten yet ... ! */ - - // change decoder and UDP/RTP scheduler clock rates - ForEach(m_clients, &cXinelibThread::TrickSpeed, -RealSpeed); -#else if (m_StreamStart || (m_TrickSpeedMode & trs_Backward)) { m_TrickSpeedMode |= trs_I_frames | trs_Backward | trs_NoAudio; @@ -788,7 +744,6 @@ void cXinelibDevice::TrickSpeed(int Speed) ForEach(m_clients, &cXinelibThread::TrickSpeed, -RealSpeed); } -#endif } else if(Speed==-1 || Speed == 0) { @@ -960,124 +915,6 @@ bool cXinelibDevice::PlayFile(const char *FileName, int Position, // Data stream handling // -int cXinelibDevice::PlayTrickSpeed(const uchar *buf, int length) -{ -#if VDRVERSNUM < 10705 - if(abs(m_TrickSpeed) > 1 && (m_TrickSpeedMode & trs_I_frames)) { - uint8_t PictureType = pes_get_picture_type(buf, length); -#ifdef LOG_TRICKSPEED - if(PictureType != NO_PICTURE && PES_HAS_PTS(buf)) { - int64_t pts = pes_get_pts(buf, length); - LOGMSG(" TrickSpeed: frame %s pts %"PRId64, picture_type_str[PictureType], pts); - } -#endif - -#if 1 - // limit I-frame rate - if(PictureType == I_FRAME) { - static int64_t t0 = 0; - int64_t t1 = cTimeMs::Now(); - if((t1 - t0) < 1000) { - int fdelay = 40*12; // = 480 ms, time of one GOP in normal speed - switch(m_TrickSpeed) { - case 6: /* 2x ff */ fdelay /= min( 2, xc.max_trickspeed); break; - case 3: /* 4x ff */ fdelay /= min( 4, xc.max_trickspeed); break; - case 1: /* 12x ff */ fdelay /= min(12, xc.max_trickspeed); break; - case 63: /* 1/6x rew */ fdelay *= 6; break; - case 48: /* 1/4x rew */ fdelay *= 4; break; - case 24: /* 1/2x rew */ fdelay *= 2; break; - default: break; - } - /* wait if data is coming in too fast */ - if(fdelay - (t1-t0) >= 40) { - m_TrickSpeedDelay = 40; - return -1; - } - - t0 += fdelay; - - pes_change_pts((uchar*)buf, length, INT64_C(0)); - } else { - t0 = t1; - } - } -#endif - } - - // - // detecting trick speed mode ? - // - if( m_TrickSpeed > 0 && (m_TrickSpeedMode & trs_PTS_check) && IS_VIDEO_PACKET(buf)) { - int64_t pts; - if (PES_HAS_PTS(buf) && (pts = pes_get_pts(buf, length)) > 0) { - uint8_t PictureType = pes_get_picture_type(buf, length); - if(PictureType != I_FRAME && PictureType != NO_PICTURE) { - // --> must be fast worward with IBP frames. - // --> PTS check does not work (frames are sent in decoder order) ! */ - m_TrickSpeedPts = pts - 1; - LOGTRICKSPEED(" Detected fast forward mode, using IBP frames"); - } - if(m_TrickSpeedPts == 0) { - m_TrickSpeedMode |= trs_NoAudio; - m_TrickSpeedPts = pts; - LOGTRICKSPEED(" Seen video pts = %"PRId64, pts); - } else { - if(pts < m_TrickSpeedPts) { - /* -> playing fast backwards */ - LOGTRICKSPEED(" Detected fast backward mode. last %"PRId64" now %"PRId64, - m_TrickSpeedPts, pts); - //if(!(m_TrickSpeedMode & trs_PTS_recalc)) - // ForEach(m_clients, &cXinelibThread::Clear); - m_TrickSpeedMode = trs_I_frames | trs_PTS_recalc | trs_NoAudio; - } else { - LOGTRICKSPEED(" Detected fast forward mode"); - if(xc.ibp_trickspeed) - m_TrickSpeedMode = trs_IPB_frames; - else - m_TrickSpeedMode = trs_I_frames; - } - } - } - } - - // - // Trick speed mode with PTS re-calc - // - if( m_TrickSpeed > 0 && (m_TrickSpeedMode & trs_PTS_recalc) && - IS_VIDEO_PACKET(buf) && PES_HAS_PTS(buf)) { - int64_t pts = pes_get_pts(buf, length); - if (pts > 0) { - - /* m_TrickSpeedPts could be 0 in case of slow backwards */ - if(m_TrickSpeedPts == 0) - m_TrickSpeedPts = pts; - - LOGTRICKSPEED(" pts %"PRId64" -> %"PRId64" (diff %"PRId64") %"PRId64"", pts, - m_TrickSpeedPts + 40*12*90, m_TrickSpeedPts + 40*12*90 - pts, - (m_TrickSpeedPts + 40*12*90)^0x80000000); - pts = m_TrickSpeedPts = m_TrickSpeedPts + 40*12*90; /* 12 frames * 40ms -> pts units */ - pts ^= 0x80000000; /* discontinuity (when mode changes) forces re-syncing of all clocks */ - pes_change_pts((uchar*)buf, length, pts); - } - } - -#if 1 - else if (m_TrickSpeedMode & trs_I_frames) { - if (IS_VIDEO_PACKET(buf) && PES_HAS_PTS(buf)) { - int64_t pts = pes_get_pts(buf, length); - if (pts > 0) { - pts ^= 0x80000000; /* discontinuity (when mode changes) forces re-syncing of all clocks */ - pes_change_pts((uchar*)buf, length, pts); - } - } - } -#endif - -#endif /* VDRVERSNUM < 10705 */ - - return 0; -} - int cXinelibDevice::PlayAny(const uchar *buf, int length) { TRACEF("cXinelibDevice::PlayAny"); @@ -1117,8 +954,6 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length) } if(m_TrickSpeed > 0) { - if(PlayTrickSpeed(buf, length) < 0) - return 0; /* wait if data is coming in too fast */ } else if(m_SkipAudio) { /* needed for still images when moving cutting marks */ if (DATA_IS_PES(buf)) @@ -1127,20 +962,19 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length) m_FreeBufs --; if(m_local) { - length = (isMpeg1 ? m_local->Play_Mpeg1_PES(buf,length) : + length = (isMpeg1 ? m_local->Play_Mpeg1_PES(buf,length) : m_local->Play(buf, length)); - } + } if(m_server && length > 0) { - int length2 = isMpeg1 ? m_server->Play_Mpeg1_PES(buf, length) : + int length2 = isMpeg1 ? m_server->Play_Mpeg1_PES(buf, length) : m_server->Play(buf, length); if(!m_local) return length2; } - + return length; } -#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION) /* * hook to PlayTs() to get PAT and PMT */ @@ -1160,11 +994,7 @@ int cXinelibDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) if (TsHasPayload(Data) && TsPayloadOffset(Data) < TS_SIZE) { int Pid = TsPid(Data); -#if VDRVERSNUM < 10733 - if (Pid == 0 || Pid == PatPmtParser()->PmtPid()) { -#else if (Pid == PATPID || PatPmtParser()->IsPmtPid(Pid)) { -#endif if (m_server) m_server->SetHeader(Data, Result, Pid == 0); @@ -1284,7 +1114,6 @@ int cXinelibDevice::PlayTsVideo(const uchar *Data, int Length) return PlayTsAny(Data, Length); } -#endif // VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION) bool cXinelibDevice::AcceptVideoPacket(const uchar *Data, int Length) { @@ -1393,9 +1222,7 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length) bool isPes = DATA_IS_PES(Data) && ((Data[3] & 0xF0) == 0xE0); bool isMpeg1 = isPes && ((Data[6] & 0xC0) != 0x80); bool isH264 = isPes && pes_is_frame_h264(Data, Length); -#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION) bool isTs = DATA_IS_TS(Data); -#endif int i; @@ -1420,7 +1247,6 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length) &mmin<int>, Length); } else if(isPes) { /*cDevice::*/PlayPes(Data, Length, m_SkipAudio); -#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION) } else if(isTs) { int written = 0, total = (Length/TS_SIZE)*TS_SIZE; while (written < total) { @@ -1431,7 +1257,6 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length) cCondWait::SleepMs(5); } TsBufferFlush(); -#endif } else { ForEach(m_clients, &cXinelibThread::Play_Mpeg2_ES, Data, Length, VIDEO_STREAM, isH264, @@ -1492,15 +1317,6 @@ bool cXinelibDevice::Poll(cPoller &Poller, int TimeoutMs) return true; } -#if VDRVERSNUM < 10705 - if(m_TrickSpeed > 1 && m_TrickSpeedDelay > 20) { - LOGTRICKSPEED(" Poll: m_TrickSpeedDelay=%d.", m_TrickSpeedDelay); - cCondWait::SleepMs(20); - m_TrickSpeedDelay -= 20; - return false; - } -#endif - if(m_FreeBufs < 1) { int result = DEFAULT_POLL_SIZE; @@ -1631,7 +1447,6 @@ eVideoSystem cXinelibDevice::GetVideoSystem(void) return cDevice::GetVideoSystem(); } -#if VDRVERSNUM >= 10708 void cXinelibDevice::GetVideoSize(int &Width, int &Height, double &VideoAspect) { Width = m_VideoSize->width; @@ -1642,7 +1457,6 @@ void cXinelibDevice::GetVideoSize(int &Width, int &Height, double &VideoAspect) VideoAspect *= (double)Width / (double)Height; } } -#endif void cXinelibDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect) { @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.h,v 1.63 2012-03-17 20:14:41 phintuka Exp $ + * $Id: device.h,v 1.64 2013-08-21 09:14:36 phintuka Exp $ * */ @@ -99,10 +99,6 @@ class cXinelibDevice : public cDevice ePlayMode m_PlayMode; int m_TrickSpeed; int m_TrickSpeedMode; -#if VDRVERSNUM < 10705 - int64_t m_TrickSpeedPts; - int m_TrickSpeedDelay; -#endif public: virtual bool SetPlayMode(ePlayMode PlayMode); @@ -125,9 +121,7 @@ class cXinelibDevice : public cDevice struct video_size_s *m_VideoSize; struct ts_state_s *m_tssVideoSize; -#if VDRVERSNUM >= 10708 virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect); -#endif virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect); // Track facilities @@ -237,7 +231,6 @@ class cXinelibDevice : public cDevice int m_FreeBufs; int PlayAny(const uchar *Data, int Length); - int PlayTrickSpeed(const uchar *buf, int length); bool AcceptVideoPacket(const uchar *Data, int Length); bool AcceptAudioPacket(const uchar *Data, int Length); @@ -253,7 +246,6 @@ class cXinelibDevice : public cDevice virtual int PlayAudio(const uchar *Data, int Length, uchar Id); virtual int PlaySubtitle(const uchar *Data, int Length); -#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION) // join multiple TS packets to xineliboutput transport packet cMutex m_TsBufLock; uint8_t m_TsBuf[4096]; @@ -269,10 +261,6 @@ class cXinelibDevice : public cDevice virtual int PlayTsAudio(const uchar *Data, int Length); virtual int PlayTsSubtitle(const uchar *Data, int Length); virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly = false); -#else - void TsBufferClear(void) {} - void TsBufferFlush(void) {} -#endif // Picture-In-Picture @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd.c,v 1.48 2011-03-20 23:04:47 phintuka Exp $ + * $Id: osd.c,v 1.49 2013-08-21 09:14:36 phintuka Exp $ * */ @@ -310,8 +310,7 @@ void cXinelibOsd::SetCmdFlags(osd_command_t& cmd) cmd.scaling = xc.osd_scaling; - if ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) || - ( m_Layer == OSD_LEVEL_TTXTSUBS)) + if (m_Layer == OSD_LEVEL_TTXTSUBS) cmd.scaling = xc.osd_spu_scaling; } @@ -434,10 +433,7 @@ eOsdError cXinelibOsd::SetAreas(const tArea *Areas, int NumAreas) return oeTooManyAreas; } -#if VDRVERSNUM >= 10708 - if (xc.osd_spu_scaling && - ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) || - ( m_Layer == OSD_LEVEL_TTXTSUBS))) { + if (xc.osd_spu_scaling && m_Layer == OSD_LEVEL_TTXTSUBS) { m_ExtentWidth = 720; m_ExtentHeight = 576; } else { @@ -448,22 +444,6 @@ eOsdError cXinelibOsd::SetAreas(const tArea *Areas, int NumAreas) m_ExtentHeight = H; } -#else - - // Detect full OSD area size - if(Left() + Width() > 720 || Top() + Height() > 576) { - m_ExtentWidth = Setup.OSDWidth + 2 * Setup.OSDLeft; - m_ExtentHeight = Setup.OSDHeight + 2 * Setup.OSDTop; - LOGDBG("Detected HD OSD, size > %dx%d, using setup values %dx%d", - 2*Left() + Width(), 2*Top() + Height(), - m_ExtentWidth, m_ExtentHeight); - } else { - m_ExtentWidth = 720; - m_ExtentHeight = 576; - } - -#endif - CmdSize(m_ExtentWidth, m_ExtentHeight); return Result; @@ -526,12 +506,6 @@ void cXinelibOsd::Flush(void) if(!m_IsVisible) return; -#ifdef YAEPGHDVERSNUM - if (vidWin.bpp) - CmdVideoWindow(vidWin.x1, vidWin.y1, vidWin.Width(), vidWin.Height()); -#endif - -#if VDRVERSNUM >= 10717 if (IsTrueColor()) { LOCK_PIXMAPS; @@ -545,13 +519,10 @@ void cXinelibOsd::Flush(void) return; } -#endif int SendDone = 0, XOffset = 0, YOffset = 0; - if (!xc.osd_spu_scaling && - ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) || - ( m_Layer == OSD_LEVEL_TTXTSUBS))) { + if (!xc.osd_spu_scaling && m_Layer == OSD_LEVEL_TTXTSUBS) { double Aspect; int W, H; m_Device->GetOsdSize(W, H, Aspect); diff --git a/xineliboutput.c b/xineliboutput.c index e9b550a9..bcaec4e5 100644 --- a/xineliboutput.c +++ b/xineliboutput.c @@ -21,7 +21,7 @@ * * xineliboutput.c: VDR Plugin interface * - * $Id: xineliboutput.c,v 1.59 2013-08-20 12:12:24 phintuka Exp $ + * $Id: xineliboutput.c,v 1.60 2013-08-21 09:14:36 phintuka Exp $ * */ @@ -37,8 +37,8 @@ #include "menu.h" #include "media_player.h" -#if defined(APIVERSNUM) && (APIVERSNUM < 10600) -# error VDR API versions < 1.6.0 are not supported ! +#if defined(APIVERSNUM) && (APIVERSNUM < 10733) +# error VDR API versions < 1.7.33 are not supported ! #endif //---------------------------------plugin------------------------------------- |