diff options
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | config.h | 3 | ||||
-rw-r--r-- | device.c | 142 | ||||
-rw-r--r-- | device.h | 16 | ||||
-rw-r--r-- | i18n.c | 22 | ||||
-rw-r--r-- | menu.c | 25 | ||||
-rw-r--r-- | menu.h | 6 | ||||
-rw-r--r-- | setup_menu.c | 8 |
8 files changed, 12 insertions, 214 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.c,v 1.2 2006-07-02 17:03:26 phintuka Exp $ + * $Id: config.c,v 1.3 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -104,7 +104,6 @@ config_t::config_t() { audio_upmix = 0; audio_surround = 0; - inactivity_timer = 0; decoder_priority = DECODER_PRIORITY_NORMAL; pes_buffers = i_pesBufferSize[PES_BUFFERS_SMALL_250]; strcpy(deinterlace_method, s_deinterlaceMethods[DEINTERLACE_NONE]); @@ -288,7 +287,6 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Remote.Rtp.TTL")) remote_rtp_ttl = atoi(Value); else if (!strcasecmp(Name, "Remote.Rtp.AlwaysOn")) remote_rtp_always_on = atoi(Value); - else if (!strcasecmp(Name, "Decoder.InactivityTimer")) inactivity_timer=atoi(Value); else if (!strcasecmp(Name, "Decoder.Priority")) decoder_priority=strstra(Value,s_decoderPriority,1); else if (!strcasecmp(Name, "Decoder.PesBuffers")) pes_buffers=atoi(Value); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.h,v 1.2 2006-07-02 17:03:26 phintuka Exp $ + * $Id: config.h,v 1.3 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -149,7 +149,6 @@ class config_t { int headphone; int audio_upmix; - int inactivity_timer; int decoder_priority; int pes_buffers; char deinterlace_method[32]; @@ -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.6 2006-07-21 22:47:12 phintuka Exp $ + * $Id: device.c,v 1.7 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -27,18 +27,6 @@ #include "config.h" #include "osd.h" -#ifdef ENABLE_SUSPEND -# include "tools/timer.h" -# include "tools/timer.c" -# ifdef SUSPEND_BY_PLAYER -# include "dummy_player.h" -# include "dummy_player.c" -# endif -# define ACTIVITY m_inactivityTimer = 0; -#else -# define ACTIVITY -#endif - #include "tools/listiter.h" #include "tools/pes.h" @@ -177,10 +165,7 @@ cXinelibDevice::cXinelibDevice() m_ac3Present = false; m_spuPresent = false; ClrAvailableDvdSpuTracks(); -#ifdef ENABLE_SUSPEND - m_suspended = false; - ACTIVITY -#endif + m_liveMode = false; m_TrickSpeed = -1; m_SkipAudio = false; @@ -228,16 +213,7 @@ bool cXinelibDevice::StartDevice() } } -#ifdef ENABLE_SUSPEND - m_suspended = false; - ACTIVITY -#endif - m_statusMonitor = new cXinelibStatusMonitor(*this, CardIndex()); - -#ifdef ENABLE_SUSPEND - CreateTimerEvent(this, &cXinelibDevice::CheckInactivityTimer, 60*1000, false); -#endif LOGDBG("cXinelibDevice::StartDevice(): Device started"); return true; @@ -247,9 +223,7 @@ void cXinelibDevice::StopDevice(void) { TRACEF("cXinelibDevice::StopDevice"); LOGDBG("cXinelibDevice::StopDevice(): Stopping device ..."); -#ifdef ENABLE_SUSPEND - CancelTimerEvents(this); -#endif + if(m_statusMonitor) { delete m_statusMonitor; m_statusMonitor = NULL; @@ -331,7 +305,6 @@ void cXinelibDevice::ConfigureOSD(bool prescale_osd, bool unscaled_osd) { TRACEF("cXinelibDevice::ConfigureOSD"); - ACTIVITY if(m_local) m_local->ConfigureOSD(prescale_osd, unscaled_osd); if(m_server) @@ -346,7 +319,6 @@ void cXinelibDevice::ConfigurePostprocessing(const char *deinterlace_method, { TRACEF("cXinelibDevice::ConfigurePostprocessing"); - ACTIVITY if(m_local) m_local->ConfigurePostprocessing(deinterlace_method, audio_delay, audio_compression, audio_equalizer, @@ -362,7 +334,6 @@ void cXinelibDevice::ConfigurePostprocessing(const char *name, bool on, { TRACEF("cXinelibDevice::ConfigurePostprocessing"); - ACTIVITY if(m_local) m_local->ConfigurePostprocessing(name, on, args); if(m_server) @@ -373,7 +344,6 @@ void cXinelibDevice::ConfigureVideo(int hue, int saturation, int brightness, int { TRACEF("cXinelibDevice::ConfigureVideo"); - ACTIVITY if(m_local) m_local->ConfigureVideo(hue, saturation, brightness, contrast); if(m_server) @@ -384,7 +354,6 @@ void cXinelibDevice::ConfigureDecoder(int pes_buffers, int priority) { TRACEF("cXinelibDevice::ConfigureDecoder"); - ACTIVITY if(m_local) m_local->ConfigureDecoder(pes_buffers, priority); //if(m_server) @@ -400,7 +369,6 @@ void cXinelibDevice::ConfigureWindow(int fullscreen, int width, int height, { TRACEF("cXinelibDevice::ConfigureWindow"); - ACTIVITY if((!*xc.local_frontend || !strncmp(xc.local_frontend, "none", 4)) && m_local) { cXinelibThread *tmp = m_local; m_clients.Del(tmp, false); @@ -442,7 +410,6 @@ void cXinelibDevice::Listen(bool activate, int port) { TRACEF("cXinelibDevice::Listen"); - ACTIVITY if(activate && port>0) { if(!m_server) { cXinelibThread *tmp = new cXinelibServer(port); @@ -482,7 +449,6 @@ void cXinelibDevice::OsdCmd(void *cmd) { TRACEF("cXinelibDevice::OsdCmd"); - ACTIVITY if(m_server) // call first server, local frontend modifies contents of the message ... m_server->OsdCmd(cmd); if(m_local) @@ -497,7 +463,6 @@ void cXinelibDevice::StopOutput(void) { TRACEF("cXinelibDevice::StopOutput"); - ACTIVITY m_RadioStream = false; m_AudioCount = 0; @@ -520,7 +485,6 @@ void cXinelibDevice::SetTvMode(cChannel *Channel) m_StreamStart = true; m_liveMode = true; - ACTIVITY m_TrickSpeed = -1; m_SkipAudio = false; m_AudioCount = 0; @@ -553,15 +517,12 @@ void cXinelibDevice::SetReplayMode(void) ForEach(m_clients, &cXinelibThread::ResumeOutput); m_liveMode = false; - ACTIVITY } bool cXinelibDevice::SetPlayMode(ePlayMode PlayMode) { TRACEF("cXinelibDevice::SetPlayMode"); - ACTIVITY - #ifdef XINELIBOUTPUT_DEBUG switch (PlayMode) { case pmNone: @@ -603,7 +564,6 @@ void cXinelibDevice::TrickSpeed(int Speed) TRACEF("cXinelibDevice::TrickSpeed"); int RealSpeed = abs(Speed); - ACTIVITY m_TrickSpeed = Speed; m_TrickSpeedPts = 0; @@ -622,7 +582,6 @@ void cXinelibDevice::Play(void) { TRACEF("cXinelibDevice::Play"); - ACTIVITY m_SkipAudio = false; ForEach(m_clients, &cXinelibThread::SetLiveMode, false); @@ -633,90 +592,10 @@ void cXinelibDevice::Freeze(void) { TRACEF("cXinelibDevice::Freeze"); - ACTIVITY - TrickSpeed(0); } // -// Suspend device, inactivity timer -// -#ifdef ENABLE_SUSPEND -void cXinelibDevice::CheckInactivityTimer() -{ - TRACEF("cXinelibDevice::CheckInactivityTimer"); - - Lock(); - - if(xc.inactivity_timer>0) { - int old_Timer = m_inactivityTimer++; - TRACE("cXinelibDevice::CheckInactivityTimer @" << time(NULL)); - TRACE("cXinelibDevice::CheckInactivityTimer: m_inactivityTimer = " << m_inactivityTimer); - - if(old_Timer<=xc.inactivity_timer && m_inactivityTimer>xc.inactivity_timer) { - SuspendedAction(); - Unlock(); -# ifndef SUSPEND_BY_PLAYER - CreateTimerEvent(this, &cXinelibDevice::SuspendedAction, 5000); -# endif - return; - } - } - Unlock(); -} - -bool cXinelibDevice::SuspendedAction(void) -{ - TRACEF("cXinelibDevice::SuspendedAction"); - - LOCK_THREAD; - if(m_suspended || (xc.inactivity_timer>0 && m_inactivityTimer>xc.inactivity_timer)) { - if(m_liveMode) { -# ifndef SUSPEND_BY_PLAYER - TRACE("cXinelibDevice::SuspendedAction - DECODER SUSPENDED"); - ForEach(m_clients, &cXinelibThread::SetLiveMode, false); - ForEach(m_clients, &cXinelibThread::LogoDisplay); -# else - if(!cDummyPlayerControl::IsOpen()) - cControl::Launch(new cDummyPlayerControl); -# endif - } - return true; - } - -# ifndef SUSPEND_BY_PLAYER - ForEach(m_clients, &cXinelibThread::SetLiveMode, m_liveMode); -# else - if(cDummyPlayerControl::IsOpen()) - cDummyPlayerControl::Close(); -# endif - - return false; -} - -void cXinelibDevice::Suspend(bool onoff) -{ - TRACEF("cXinelibDevice::Suspend"); - TRACE("cXinelibDevice::Suspend = " << onoff); - - Lock(); - ACTIVITY - - if(!m_suspended && onoff) { - m_suspended = onoff; - SuspendedAction(); - Unlock(); -#ifndef SUSPEND_BY_PLAYER - CreateTimerEvent(this, &cXinelibDevice::SuspendedAction, 5000); -#endif - return; - } - m_suspended = onoff; - Unlock(); -} -#endif // ENABLE_SUSPEND - -// // Playback of files and images // @@ -780,15 +659,6 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length) if(m_PlayingFile) return length; -#ifdef ENABLE_SUSPEND - if(m_suspended || (xc.inactivity_timer > 0 && - m_inactivityTimer > xc.inactivity_timer)) { - if(m_liveMode) { - return length; - } - } -#endif - bool isMpeg1 = false; int len = pes_packet_len(buf, length, isMpeg1); @@ -1005,7 +875,6 @@ void cXinelibDevice::SetVolumeDevice(int Volume) { TRACEF("cXinelibDevice::SetVolumeDevice"); - ACTIVITY ForEach(m_clients, &cXinelibThread::SetVolume, Volume); } @@ -1064,9 +933,8 @@ void cXinelibDevice::SetDigitalAudioDevice(bool On) void cXinelibDevice::SetVideoFormat(bool VideoFormat16_9) { TRACEF("cXinelibDevice::SetVideoFormat"); - LOGDBG("SetVideoFormat(%s)", VideoFormat16_9 ? "16:9" : "4:3"); - ACTIVITY + cDevice::SetVideoFormat(VideoFormat16_9); // @@ -1278,7 +1146,6 @@ bool cXinelibDevice::GrabImage(const char *FileName, bool Jpeg, int Size = 0; TRACEF("cXinelibDevice::GrabImage"); - ACTIVITY if(m_local) Data = m_local->GrabImage(Size, Jpeg, Quality, SizeX, SizeY); if(!Data && m_server) @@ -1307,7 +1174,6 @@ uchar *cXinelibDevice::GrabImage(int &Size, bool Jpeg, { TRACEF("cXinelibDevice::GrabImage"); - ACTIVITY if(m_local) return m_local->GrabImage(Size, Jpeg, Quality, SizeX, SizeY); if(m_server) @@ -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.4 2006-07-21 22:45:22 phintuka Exp $ + * $Id: device.h,v 1.5 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -116,15 +116,6 @@ class cXinelibDevice : public cDevice int PlayFileCtrl(const char *Cmd); bool EndOfStreamReached(void); -#ifdef ENABLE_SUSPEND - // Suspend decoder - //void Housekeeping(void); - bool IsSuspended() {return m_suspended;}; - void Suspend(bool onoff); - bool SuspendedAction(void); - void CheckInactivityTimer(void); -#endif - private: int PlayAny(const uchar *Data, int Length); @@ -169,10 +160,7 @@ class cXinelibDevice : public cDevice bool m_ac3Present; bool m_spuPresent; -#ifdef ENABLE_SUSPEND - bool m_suspended; - int m_inactivityTimer; -#endif + bool m_liveMode; int m_TrickSpeed; int64_t m_TrickSpeedPts; @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: i18n.c,v 1.1 2006-06-03 10:01:17 phintuka Exp $ + * $Id: i18n.c,v 1.2 2006-08-07 18:20:43 phintuka Exp $ * * Translations provided by: * @@ -218,26 +218,6 @@ const tI18nPhrase Phrases[] = { "", // Croatian }, { - "Stop after inactivity", // English - "", // Deutsch - "", // Slovenski - "", // Italiano - "", // Nederlands - "", // Português - "", // Français - "", // Norsk - "Pysäytä käytön jälkeen", // Suomi - "", // Polski - "", // Español - "", // Ellinika - "", // Svenska - "", // Romaneste - "", // Magyar - "", // Catala - "¾áâÐÝÞÒØâì ßÞáÛÕ ÝÕÐÚâØÒÝÞáâØ", // Russian - "", // Croatian - }, - { "Brightness", // English "", // Deutsch "", // Slovenski @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menu.c,v 1.3 2006-08-07 17:12:29 phintuka Exp $ + * $Id: menu.c,v 1.4 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -20,11 +20,6 @@ #include "menu.h" #include "menuitems.h" #include "device.h" -#ifdef ENABLE_SUSPEND -# ifdef SUSPEND_BY_PLAYER -# include "dummy_player.h" -# endif -#endif #include "media_player.h" #include "equalizer.h" @@ -655,9 +650,6 @@ extern cOsdObject *g_PendingMenuAction; cMenuXinelib::cMenuXinelib() { field_order = xc.field_order; -#ifdef ENABLE_SUSPEND - suspend = cXinelibDevice::Instance().IsSuspended(); -#endif compression = xc.audio_compression; headphone = xc.headphone; autocrop = xc.autocrop; @@ -679,9 +671,6 @@ cMenuXinelib::cMenuXinelib() #ifdef HAVE_XV_FIELD_ORDER Add(video_ctrl_interlace_order = new cMenuEditStraI18nItem(tr("Interlaced Field Order"), &field_order, 2, xc.s_fieldOrder)); #endif -#ifdef ENABLE_SUSPEND - Add(decoder_ctrl_suspend = new cMenuEditStraI18nItem(tr("Decoder state"), &suspend, 2, decoderState)); -#endif Add(audio_ctrl_compress = new cMenuEditTypedIntItem(tr("Audio Compression"),"%", &compression, 100, 500, tr("Off"))); Add(new cOsdItem(tr("Audio Equalizer >>"), osUser3)); @@ -779,18 +768,6 @@ eOSState cMenuXinelib::ProcessKey(eKeys Key) cXinelibDevice::Instance().ConfigurePostprocessing("headphone", headphone?true:false); else if(item == ctrl_autocrop) cXinelibDevice::Instance().ConfigurePostprocessing("autocrop", autocrop?true:false); -#ifdef ENABLE_SUSPEND - else if(decoder_ctrl_suspend && item == decoder_ctrl_suspend) { - cXinelibDevice::Instance().Suspend(suspend); -# ifdef SUSPEND_BY_PLAYER - if(suspend && !cDummyPlayerControl::IsOpen()) { - cControl::Launch(new cDummyPlayerControl); - } else { - cDummyPlayerControl::Close(); - } -# endif - } -#endif #ifdef HAVE_XV_FIELD_ORDER else if(video_ctrl_interlace_order && item == video_ctrl_interlace_order) cXinelibDevice::Instance().ConfigureWindow(xc.fullscreen, xc.width, xc.height, xc.modeswitch, xc.modeline, xc.display_aspect, xc.scale_video, field_order); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menu.h,v 1.1 2006-06-03 09:50:54 phintuka Exp $ + * $Id: menu.h,v 1.2 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -22,10 +22,6 @@ class cMenuXinelib : public cMenuSetupPage int headphone; int autocrop; -#ifdef ENABLE_SUSPEND - int suspend; - cOsdItem *decoder_ctrl_suspend; -#endif #ifdef HAVE_XV_FIELD_ORDER cOsdItem *video_ctrl_interlace_order; #endif diff --git a/setup_menu.c b/setup_menu.c index 42ef5a8c..5700438a 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: setup_menu.c,v 1.3 2006-08-07 17:11:51 phintuka Exp $ + * $Id: setup_menu.c,v 1.4 2006-08-07 18:20:43 phintuka Exp $ * */ @@ -646,11 +646,6 @@ void cMenuSetupDecoder::Set(void) Add(NewTitle("Decoder")); Add(new cMenuEditStraI18nItem(tr("Priority"), &xc.decoder_priority, DECODER_PRIORITY_count, xc.s_decoderPriority)); -#ifdef ENABLE_SUSPEND - Add(new cMenuEditTypedIntItem(tr("Stop after inactivity"), tr("min"), - &newconfig.inactivity_timer, 0, 1440, - tr("Off"))); -#endif Add(ctrl_pes_buffers_ind = new cMenuEditStraI18nItem(tr("Buffer size"), &pes_buffers_ind, PES_BUFFERS_count, xc.s_bufferSize)); @@ -696,7 +691,6 @@ void cMenuSetupDecoder::Store(void) if(pes_buffers_ind != PES_BUFFERS_CUSTOM) xc.pes_buffers = xc.i_pesBufferSize[pes_buffers_ind]; - SetupStore("Decoder.InactivityTimer", xc.inactivity_timer); SetupStore("Decoder.Priority", xc.s_decoderPriority[xc.decoder_priority]); SetupStore("Decoder.PesBuffers", xc.pes_buffers); |