diff options
author | scop <scop> | 2005-06-22 16:57:57 +0000 |
---|---|---|
committer | scop <scop> | 2005-06-22 16:57:57 +0000 |
commit | 1b8747dd7a9e55aec4c2aaf1048b58c95c4c2b00 (patch) | |
tree | d906db82625bc4b6e86d8f1bba1d749107313b03 | |
parent | 7cfced59ba4bd5100d681783a74cbb327adfb525 (diff) | |
download | vdr-plugin-dxr3-1b8747dd7a9e55aec4c2aaf1048b58c95c4c2b00.tar.gz vdr-plugin-dxr3-1b8747dd7a9e55aec4c2aaf1048b58c95c4c2b00.tar.bz2 |
Use VDR's logging facilities, no more dxr3plugin.log.
-rw-r--r-- | HISTORY | 6 | ||||
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | dxr3.c | 26 | ||||
-rw-r--r-- | dxr3.h | 3 | ||||
-rw-r--r-- | dxr3audiodecoder.c | 25 | ||||
-rw-r--r-- | dxr3audiodecoder.h | 1 | ||||
-rw-r--r-- | dxr3colormanager.c | 12 | ||||
-rw-r--r-- | dxr3configdata.c | 2 | ||||
-rw-r--r-- | dxr3configdata.h | 40 | ||||
-rw-r--r-- | dxr3demuxdevice.c | 14 | ||||
-rw-r--r-- | dxr3device.c | 65 | ||||
-rw-r--r-- | dxr3device.h | 1 | ||||
-rw-r--r-- | dxr3ffmpeg.c | 17 | ||||
-rw-r--r-- | dxr3i18n.c | 104 | ||||
-rw-r--r-- | dxr3interface.c | 136 | ||||
-rw-r--r-- | dxr3interface.h | 1 | ||||
-rw-r--r-- | dxr3interface_spu_encoder.c | 15 | ||||
-rw-r--r-- | dxr3log.c | 75 | ||||
-rw-r--r-- | dxr3log.h | 108 | ||||
-rw-r--r-- | dxr3multichannelaudio.c | 1 | ||||
-rw-r--r-- | dxr3outputthread.c | 5 | ||||
-rw-r--r-- | dxr3pesframe.c | 4 | ||||
-rw-r--r-- | dxr3spudecoder.c | 64 | ||||
-rw-r--r-- | dxr3syncbuffer.c | 16 | ||||
-rw-r--r-- | dxr3syncbuffer.h | 1 |
26 files changed, 119 insertions, 632 deletions
@@ -240,13 +240,9 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - added many comments into source (Christian Gmeiner) - using doxygen for docs (Christian Gmeiner) - made path to microcode configurable in Makefile (Sascha Volkenandt) -- made log dir configurable in Makefile (Christian Gmeiner, Martin Dauskardt) - You may also want to search and remove files called "dxr3plugin.log" as the - old plugin wrote them into the current working directory. - better default directories in Makefile (Christian Gmeiner, vdr-wiki.de folks) - use std:: instead of namespace std (bug #1044069, Christian Gmeiner, Ville Skyttä) -- removed extra log commands in dxr3outputthread.c (Christian Gmeiner) - fixed #includes: moved #include "dxr3osd.h" from dxr3interface.h to dxr3interface.c, removed not needed #includes (Christian Gmeiner) - added support for VDR 1.3.13 and later (Luca Olivetti, Peter Dittmann) @@ -288,3 +284,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - clean up dead code for old VDR versions that hasn't worked for some time anyway, VDR >= 1.3.11 is now required (Ville Skyttä) - improve recovery and avoid lockups caused by bad streams (Jon Burgess) +- use VDR's facilities for logging (no more dxr3plugin.log), make it less + noisy (Ville Skyttä, Christian Gmeiner) @@ -12,7 +12,7 @@ Installation: - Unpack the package into "PLUGINS/SRC" directory. - Make a symbolic link to this dxr3-plugin (ln -s vdr_dxr3_x.x.x dxr3). - Check FFMDIR and EM8300 in Makefile. -- Check extra settings in Makefile: -DMICROCODE, -DLOGPATH, -DUSE_XINE_SCALER +- Check extra settings in Makefile: -DMICROCODE, -DUSE_XINE_SCALER - Call "make plugins" in the VDR root directory. - Make sure your DXR3 driver modules are loaded and ready to run. - Start VDR with "vdr -Pdxr3". @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.1.2.16 2005/05/17 20:26:00 scop Exp $ +# $Id: Makefile,v 1.1.2.17 2005/06/22 16:57:58 scop Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. @@ -50,9 +50,6 @@ DEFINES += -D_GNU_SOURCE # where is the microcode for the dxr3 located? DEFINES += -DMICROCODE=\"/usr/share/misc/em8300.uc\" -# where should we write our log? -DEFINES += -DLOGPATH=\"/video/\" # note: path must end with / - # use OSD scaler borrowed from the Xine plugin? # comment this out to use the traditional vdr-dxr3 scaler DEFINES += -DUSE_XINE_SCALER @@ -68,7 +65,7 @@ DEFINES += -DFLUSHRATE=40 OBJS = $(PLUGIN).o dxr3multichannelaudio.o dxr3sysclock.o dxr3colormanager.o dxr3syncbuffer.o dxr3audiodecoder.o \ dxr3blackframe.o dxr3nextpts.o dxr3pesframe.o dxr3demuxdevice.o dxr3configdata.o \ -dxr3log.o dxr3ffmpeg.o dxr3interface_spu_encoder.o dxr3i18n.o \ +dxr3ffmpeg.o dxr3interface_spu_encoder.o dxr3i18n.o \ dxr3interface.o dxr3device.o dxr3outputthread.o dxr3osd.o dxr3osd_subpicture.o dxr3spudecoder.o ### Default target: @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dxr3.c,v 1.1.2.12 2005/05/28 10:03:25 scop Exp $ + * $Id: dxr3.c,v 1.1.2.13 2005/06/22 16:57:58 scop Exp $ * */ @@ -42,7 +42,6 @@ eOSState cDxr3OsdItem::ProcessKey(eKeys Key) break; case DXR3_ANALOG_OUT: - cLog::Instance() << "Changing audio to analog\n"; cDxr3ConfigData::Instance().SetUseDigitalOut(0); cDxr3ConfigData::Instance().SetAc3OutPut(0); if (cDxr3Device::InstanceP()) @@ -50,7 +49,6 @@ eOSState cDxr3OsdItem::ProcessKey(eKeys Key) break; case DXR3_DIGITAL_OUT: - cLog::Instance() << "Changing audio to digital\n"; cDxr3ConfigData::Instance().SetUseDigitalOut(1); cDxr3ConfigData::Instance().SetAc3OutPut(0); if (cDxr3Device::InstanceP()) @@ -58,7 +56,6 @@ eOSState cDxr3OsdItem::ProcessKey(eKeys Key) break; case DXR3_AC3_OUT: - cLog::Instance() << "Changing audio to ac3\n"; cDxr3ConfigData::Instance().SetAc3OutPut(!cDxr3ConfigData::Instance().GetAc3OutPut()); if (cDxr3Device::InstanceP()) cDxr3Device::InstanceP()->Reset(); @@ -83,13 +80,6 @@ cMenuSetupDxr3::cMenuSetupDxr3(void) menuVideoModes[2] = tr("NTSC"); Add(new cMenuEditStraItem(tr("Video mode"), &newVideoMode, 3, menuVideoModes)); - newDebug = (int) cDxr3ConfigData::Instance().GetDebug(); - Add(new cMenuEditBoolItem(tr("Debug mode"), &newDebug)); - newDebugLevel = (int) cDxr3ConfigData::Instance().GetDebugLevel(); - menuDebugModes[0] = tr("low"); - menuDebugModes[1] = tr("everything"); - Add(new cMenuEditStraItem(tr("Debug level"), - &newDebugLevel, 2, menuDebugModes)); } // ================================== @@ -102,10 +92,6 @@ void cMenuSetupDxr3::Store(void) cDxr3ConfigData::Instance().SetDxr3Card(newDxr3Card)); SetupStore("Dxr3VideoMode", cDxr3ConfigData::Instance().SetVideoMode((eVideoMode) newVideoMode)); - SetupStore("Dxr3Debug", - cDxr3ConfigData::Instance().SetDebug(newDebug)); - SetupStore("Dxr3DebugLevel", - cDxr3ConfigData::Instance().SetDebugLevel(newDebugLevel)); } // ================================== @@ -201,21 +187,11 @@ bool cPluginDxr3::SetupParse(const char *Name, const char *Value) cDxr3ConfigData::Instance().SetDxr3Card(atoi(Value)); return true; } - if (!strcasecmp(Name, "Dxr3Debug")) - { - cDxr3ConfigData::Instance().SetDebug(atoi(Value)); - return true; - } if (!strcasecmp(Name, "Dxr3VideoMode")) { cDxr3ConfigData::Instance().SetVideoMode((eVideoMode) atoi(Value)); return true; } - if (!strcasecmp(Name, "Dxr3DebugLevel")) - { - cDxr3ConfigData::Instance().SetDebugLevel(atoi(Value)); - return true; - } return false; } @@ -17,10 +17,7 @@ private: int newUseDigitalOut; int newDxr3Card; int newVideoMode; - int newDebug; - int newDebugLevel; const char *menuVideoModes[3]; - const char *menuDebugModes[2]; }; diff --git a/dxr3audiodecoder.c b/dxr3audiodecoder.c index 17ea0fe..153d501 100644 --- a/dxr3audiodecoder.c +++ b/dxr3audiodecoder.c @@ -109,11 +109,9 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, { if ((buf[i+2] & 0xFC) != (lastHeader[2] & 0xFC)) { - cLog::Instance() << "cDxr3AudioDecoder::Decode Found different audio header -> init\n"; - cLog::Instance() << "cDxr3AudioDecoder::Decode Old header 0x" - << std::hex << *((uint32_t*) lastHeader) - << " new header 0x" << *((uint32_t*) (buf+i)) - << std::dec << "\n"; + dsyslog("dxr3: audiodecoder: found different audio header" + " (new: %#x, old: %#x), (re)initializing", + *((uint32_t*) lastHeader), *((uint32_t*) (buf+i))); Init(); lastHeader[0] = buf[i]; @@ -151,18 +149,18 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, if (Codec.codec_context.sample_rate != rate) { - cLog::Instance() << "cDxr3AudioDecoder::Decode Sample rate = " - << Codec.codec_context.sample_rate << "\n"; + dsyslog("dxr3: audiodecoder: sample rate=%d", + Codec.codec_context.sample_rate); if (rate != -1) throw UNEXPECTED_PARAMETER_CHANGE; rate = Codec.codec_context.sample_rate; } if (Codec.codec_context.channels != channels + 1) { + dsyslog("dxr3: audiodecoder: channels=%d", + Codec.codec_context.channels); if (channels != -1) throw UNEXPECTED_PARAMETER_CHANGE; channels = (Codec.codec_context.channels == 2) ? 1 : 0; - cLog::Instance() << "cDxr3AudioDecoder::Decode channels = " - << Codec.codec_context.channels << "\n"; } if (out_size) { @@ -180,19 +178,18 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, switch (ex) { case WRONG_LENGTH: - cLog::Instance() << "cDxr3AudioDecoder::Decode wrong length\n"; + esyslog("dxr3: audiodecoder: wrong length"); break; case UNEXPECTED_PARAMETER_CHANGE: - cLog::Instance() << "cDxr3AudioDecoder::Decode unexpected parameter change\n"; + esyslog("dxr3: audiodecoder: unexpected parameter change"); break; default: - cLog::Instance() << "cDxr3AudioDecoder::Decode unexpeced exception\n"; + esyslog("dxr3: audiodecoder: unexpected exception"); break; } - dsyslog("cDxr3AudioDecoder::Decode skipping %d broken data bytes", - length); + esyslog("dxr3: audiodecoder: skipping %d broken data bytes", length); Init(); } diff --git a/dxr3audiodecoder.h b/dxr3audiodecoder.h index 33bde7b..4a199d5 100644 --- a/dxr3audiodecoder.h +++ b/dxr3audiodecoder.h @@ -29,7 +29,6 @@ #include "dxr3ffmpeg.h" #include "dxr3syncbuffer.h" #include "dxr3multichannelaudio.h" -#include "dxr3log.h" // ================================== // decode audio to mp2 or use DD :) diff --git a/dxr3colormanager.c b/dxr3colormanager.c index f8b4002..044d254 100644 --- a/dxr3colormanager.c +++ b/dxr3colormanager.c @@ -51,7 +51,7 @@ #include <assert.h> #include "dxr3colormanager.h" -#include "dxr3log.h" +#include <vdr/tools.h> #include <stdio.h> #include <string.h> @@ -140,8 +140,8 @@ void cColorManager::EncodeColors(int width, int height, unsigned char* map, } else { - // give up - cLog::Instance() << "dxr3colormanager: too many regions!\n"; + esyslog("dxr3: colormanager: too many regions (%d)" + " - giving up", NrOfRegions); return; } } @@ -260,8 +260,7 @@ void cColorManager::NextSection(void) if (curSectionIndex < curRegion->N) curSection=curRegion->Section[curSectionIndex]; // it shouldn't happen - else cLog::Instance() << - "dxr3colormanager: no more sections in NextSection!\n"; + else esyslog("dxr3: colormanager: ran out of sections"); } // ================================== @@ -327,7 +326,8 @@ void cColorManager::NewSection(int x) { int N = curRegion->N; if (N >= MAX_NO_OF_SECTIONS - 1) { - cLog::Instance() << "dxr3colormanager: bummer, too many sections\n"; + esyslog("dxr3: colormanager: bummer, too many sections (%d)," + " reusing last one", N); return; // reuse last section, not optimal but there's no other way out } curSection = new xSection(x); diff --git a/dxr3configdata.c b/dxr3configdata.c index 1a77687..35a1544 100644 --- a/dxr3configdata.c +++ b/dxr3configdata.c @@ -32,8 +32,6 @@ cDxr3ConfigData::cDxr3ConfigData() m_forceletterbox = 0; m_videomode = PAL; m_menumode = SUBPICTURE; - m_debug = 1; - m_debuglevel = 0; m_brightness = 500; m_contrast = 500; m_saturation = 500; diff --git a/dxr3configdata.h b/dxr3configdata.h index 3ee4e37..fe6a4f6 100644 --- a/dxr3configdata.h +++ b/dxr3configdata.h @@ -43,14 +43,6 @@ enum eMenuMode }; // ================================== -//! possible debug levels -enum eDebugLevel -{ - LOW = 0, ///< only log basic warings and errors - EVERYTHING ///< log everything - note logfile can become very big -}; - -// ================================== //! global interface to access all config datas of this plugin /* With this singleton you can access very easy all possible @@ -112,36 +104,6 @@ public: return m_menumode = menuMode; } - int GetDebug() const - { - return m_debug; - } - int SetDebug(int value) - { - return m_debug = value; - } - int GetDebugLevel() const - { - return m_debuglevel; - } - int SetDebugLevel(int value) - { - return m_debuglevel = value; - } - - // some little helpers to save some writing - int GetDebugLow() const - { - return (m_debug && !m_debuglevel); - } - int GetDebugEverything() const - { - if (m_debug && !m_debuglevel) - return 1; - else - return 0; - } - int GetBrightness() const { return m_brightness; @@ -175,8 +137,6 @@ protected: int m_ac3output; int m_card; int m_forceletterbox; - int m_debug; - int m_debuglevel; int m_brightness; int m_contrast; int m_saturation; diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c index 6523768..38e59fe 100644 --- a/dxr3demuxdevice.c +++ b/dxr3demuxdevice.c @@ -25,10 +25,8 @@ #include <unistd.h> #include "dxr3demuxdevice.h" #include <linux/em8300.h> -#include "dxr3log.h" #include "dxr3pesframe.h" #include "dxr3configdata.h" -#include "dxr3log.h" // ================================== //! constructor @@ -43,7 +41,7 @@ cDxr3DemuxDevice::cDxr3DemuxDevice(cDxr3Interface& dxr3Device) : m_pAudioThread = new cDxr3AudioOutThread(dxr3Device, m_aBuf); if (!m_pAudioThread) { - cLog::Instance() << "cDxr3DemuxDevice::cDxr3DemuxDevice: failed to allocate memory\n"; + esyslog("dxr3: fatal: unable to allocate memory for audio thread"); exit(1); } m_pAudioThread->Start(); @@ -51,7 +49,7 @@ cDxr3DemuxDevice::cDxr3DemuxDevice(cDxr3Interface& dxr3Device) : m_pVideoThread = new cDxr3VideoOutThread(dxr3Device, m_vBuf); if (!m_pVideoThread) { - cLog::Instance() << "cDxr3DemuxDevice::cDxr3DemuxDevice: failed to allocate memory\n"; + esyslog("dxr3: fatal: unable to allocate memory for video thread"); exit(1); } m_pVideoThread->Start(); @@ -248,7 +246,7 @@ void cDxr3DemuxDevice::StillPicture(const uint8_t* buf, int length) m_trickState = DXR3_FREEZE; m_dxr3Device.SingleStep(); - cLog::Instance() << "StillPicture: len = " << length << "\n"; + dsyslog("dxr3: demux: stillpicture length: %d", length); DemuxPes(buf, length); DemuxPes(buf, length); @@ -345,7 +343,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) switch (pesFrame.GetFrameType()) { case I_FRAME: - cLog::Instance() << "i - frame\n"; + dsyslog("dxr3: demux: I-frame"); m_dxr3Device.SingleStep(); bPlaySuc = true; //if (bPlayedFrame) return length; @@ -357,7 +355,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) break; case UNKNOWN_FRAME: - cLog::Instance() << "frame unknown\n"; + dsyslog("dxr3: demux: unknown frame"); if (bPlaySuc) { m_dxr3Device.PlayVideoFrame(pesFrame.GetEsStart(), (int) (pesFrame.GetEsLength()), m_ReUseFrame); @@ -365,7 +363,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) break; default: - cLog::Instance() << "default frame\n"; + dsyslog("dxr3: demux: default frame"); if (bPlaySuc) { m_dxr3Device.PlayVideoFrame(pesFrame.GetEsStart(), (int) (pesFrame.GetOffset()), m_ReUseFrame); diff --git a/dxr3device.c b/dxr3device.c index 93005a6..2b3edbc 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -78,36 +78,6 @@ bool cDxr3Device::CanReplay() const // ================================== bool cDxr3Device::SetPlayMode(ePlayMode PlayMode) { - if (cDxr3ConfigData::Instance().GetDebug()) - { - switch (PlayMode) - { - case pmNone: - cLog::Instance() << "cDxr3Device::SetPlayMode audio/video from decoder\n"; - break; - - case pmAudioVideo: - cLog::Instance() << "cDxr3Device::SetPlayMode audio/video from player\n"; - break; - - case pmAudioOnly: - cLog::Instance() << "cDxr3Device::SetPlayMode audio only from player, video from decoder\n"; - break; - - case pmAudioOnlyBlack: - cLog::Instance() << "cDxr3Device::SetPlayMode audio only from player, no video (black screen)\n"; - break; - - case pmExtern_THIS_SHOULD_BE_AVOIDED: - cLog::Instance() << "cDxr3Device::SetPlayMode this should be avoided\n"; - break; - - case pmVideoOnly: - cLog::Instance() << "cDxr3Device::SetPlayMode video only from player, audio from decoder\n"; - break; - } - } - if (PlayMode == pmExtern_THIS_SHOULD_BE_AVOIDED) { Tools::WriteInfoToOsd(tr("DXR3: releasing devices")); @@ -142,26 +112,24 @@ bool cDxr3Device::SetPlayMode(ePlayMode PlayMode) m_DemuxDevice.Stop(); } - cLog::Instance() << "Setting audio mode..."; - if (cDxr3ConfigData::Instance().GetUseDigitalOut()) { if (cDxr3ConfigData::Instance().GetAc3OutPut() && m_CalledBySet) { + isyslog("dxr3: Setting AC3 audio mode"); cDxr3Interface::Instance().SetAudioDigitalAC3(); // !!! FIXME - cLog::Instance() << "ac3\n"; } else { + isyslog("dxr3: Setting digital PCM audio mode"); cDxr3Interface::Instance().SetAudioDigitalPCM(); cDxr3ConfigData::Instance().SetAc3OutPut(0); - cLog::Instance() << "digital pcm\n"; } } else { + isyslog("dxr3: Setting analog audio mode"); cDxr3Interface::Instance().SetAudioAnalog(); - cLog::Instance() << "analog\n"; } return true; @@ -176,31 +144,10 @@ int64_t cDxr3Device::GetSTC() // ================================== void cDxr3Device::TrickSpeed(int Speed) { - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Device::TrickSpeed(int Speed): " - << Speed << "\n"; - } + dsyslog("dxr3: device: tricspeed: %d", Speed); m_DemuxDevice.SetTrickMode(DXR3_FAST, Speed); - - /* - switch (Speed) - { - case 6: - cLog::Instance() << "Trickspeed: 1x vorwärts\n"; - break; - - case 3: - cLog::Instance() << "Trickspeed: 2x vorwärts\n"; - break; - - case 1: - cLog::Instance() << "Trickspeed: 3x vorwärts\n"; - break; - }; - */ /* 6 ... 1x vowärts 3 ... 2x vowärts @@ -481,10 +428,6 @@ bool cDxr3Device::GrabImage(const char *FileName, bool Jpeg, int Quality, // ================================== void cDxr3Device::SetVideoFormat(bool VideoFormat16_9) { - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Device::SetPlayMode(ePlayMode PlayMode)() done\n"; - } // Do we need this function? } diff --git a/dxr3device.h b/dxr3device.h index 10ec48d..7c3f742 100644 --- a/dxr3device.h +++ b/dxr3device.h @@ -24,7 +24,6 @@ #define _DXR3_DEVICE_H_ #include "dxr3interface.h" -#include "dxr3log.h" #include "dxr3demuxdevice.h" #include "dxr3spudecoder.h" #include <string> diff --git a/dxr3ffmpeg.c b/dxr3ffmpeg.c index b7309e5..acc8a04 100644 --- a/dxr3ffmpeg.c +++ b/dxr3ffmpeg.c @@ -21,7 +21,7 @@ #include "dxr3ffmpeg.h" #include "dxr3configdata.h" -#include "dxr3log.h" +#include <vdr/tools.h> // ================================== //! constructor @@ -41,12 +41,8 @@ bool cDxr3Ffmepg::FindCodec(struct Dxr3Codec& Codec) if (!Codec.codec) { - // codec is't supported by ffmpeg - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Ffmepg::FindCodec() codec not found (" - << Codec.id << ")\n"; - } + esyslog("dxr3: ffmpeg: codec %#.5x not found - not supported" + " by FFmpeg?", Codec.id); return false; } @@ -65,12 +61,7 @@ bool cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec) if (result < 0) { - // we could not open codec - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Ffmepg::OpenCodec() coudnt open codec (" - << Codec.id << ")\n"; - } + esyslog("dxr3: ffmpeg: couldn't open codec %#.5x", Codec.id); return false; } else @@ -544,110 +544,6 @@ const tI18nPhrase Phrases[] = { #endif #endif }, - { - "Debug mode", - "", // Deutsch - "", // Slovenski - "", // Italiano - "", // Nederlands - "", // Português - "", // Français - "", // Norsk - "Debug-tila", - "", // Polski - "", // Español - "", // ÅëëçíéêÜ (Greek) - "", // Svenska - "", // Românã - "", // Magyar - "", // Català - "", // ÀãááÚØÙ (Russian) - "", // Hrvatski -#if VDRVERSNUM > 10312 - "", // Eesti -#if VDRVERSNUM > 10315 - "", // Dansk -#endif -#endif - }, - { - "Debug level", - "", // Deutsch - "", // Slovenski - "", // Italiano - "", // Nederlands - "", // Português - "", // Français - "", // Norsk - "Debug-taso", - "", // Polski - "", // Español - "", // ÅëëçíéêÜ (Greek) - "", // Svenska - "", // Românã - "", // Magyar - "", // Català - "", // ÀãááÚØÙ (Russian) - "", // Hrvatski -#if VDRVERSNUM > 10312 - "", // Eesti -#if VDRVERSNUM > 10315 - "", // Dansk -#endif -#endif - }, - { - "low", - "", // Deutsch - "", // Slovenski - "", // Italiano - "", // Nederlands - "", // Português - "", // Français - "", // Norsk - "alhainen", - "", // Polski - "", // Español - "", // ÅëëçíéêÜ (Greek) - "", // Svenska - "", // Românã - "", // Magyar - "", // Català - "", // ÀãááÚØÙ (Russian) - "", // Hrvatski -#if VDRVERSNUM > 10312 - "", // Eesti -#if VDRVERSNUM > 10315 - "", // Dansk -#endif -#endif - }, - { - "everything", - "", // Deutsch - "", // Slovenski - "", // Italiano - "", // Nederlands - "", // Português - "", // Français - "", // Norsk - "kaikki", - "", // Polski - "", // Español - "", // ÅëëçíéêÜ (Greek) - "", // Svenska - "", // Românã - "", // Magyar - "", // Català - "", // ÀãááÚØÙ (Russian) - "", // Hrvatski -#if VDRVERSNUM > 10312 - "", // Eesti -#if VDRVERSNUM > 10315 - "", // Dansk -#endif -#endif - }, { NULL } }; diff --git a/dxr3interface.c b/dxr3interface.c index c39fd9a..cd3c857 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -52,7 +52,7 @@ static int Dxr3Open(const char *Name, int n, int Mode) if (fd < 0) { - cLog::Instance() << "Unable to open " << FileName << "\n"; + esyslog("dxr3: unable to open %s: %m", FileName); } return fd; } @@ -67,7 +67,7 @@ cDxr3Interface::cDxr3Interface() : O_WRONLY | O_SYNC); if (m_fdControl < 0) { - cLog::Instance() << "Please check if the dxr3 modules are loaded!\n"; + esyslog("dxr3: please verify that the em8300 modules are loaded"); exit(1); } @@ -85,7 +85,8 @@ cDxr3Interface::cDxr3Interface() : // everything ok? if (m_fdVideo < 0 || m_fdAudio < 0 || m_fdSpu < 0) { - cLog::Instance() << "Unable to open one of the 'multimedia' streams!\n"; + + esyslog("dxr3: fatal: unable to open some em8300 devices"); exit(1); } @@ -95,7 +96,7 @@ cDxr3Interface::cDxr3Interface() : // everything ok? if (!m_pClock) { - cLog::Instance() << "Unable to allocate memory for m_pClock in cDxr3Interface\n"; + esyslog("dxr3: fatal: unable to allocate memory for em8300 clock"); exit(1); } @@ -119,16 +120,14 @@ cDxr3Interface::cDxr3Interface() : ConfigureDevice(); // get bcs values from driver - ioctl(m_fdControl, EM8300_IOCTL_GETBCS, &m_bcs); - - if (cDxr3ConfigData::Instance().GetDebug()) + if (ioctl(m_fdControl, EM8300_IOCTL_GETBCS, &m_bcs) < 0) { - cLog::Instance() << "DXR3: brightness: " - << m_bcs.brightness << "\n"; - cLog::Instance() << "DXR3: contrast: " - << m_bcs.contrast << "\n"; - cLog::Instance() << "DXR3: saturation: " - << m_bcs.saturation << "\n"; + esyslog("dxr3: failed to get brightness/contrast/saturation: %m"); + } + else + { + dsyslog("dxr3: intf: brightness=%d,contrast=%d,saturation=%d at init", + m_bcs.brightness, m_bcs.contrast, m_bcs.saturation); } PlayBlackFrame(); @@ -189,7 +188,7 @@ void cDxr3Interface::SetAudioAnalog() m_audioMode = ioval = EM8300_AUDIOMODE_ANALOG; if (ioctl(m_fdControl, EM8300_IOCTL_SET_AUDIOMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3AbsDevice::SetAudioAnalog Unable to set audiomode!\n"; + esyslog("dxr3: unable to set analog audio mode: %m"); } if (prevMode == EM8300_AUDIOMODE_DIGITALAC3) { @@ -214,7 +213,7 @@ void cDxr3Interface::SetAudioDigitalPCM() if (ioctl(m_fdControl, EM8300_IOCTL_SET_AUDIOMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3AbsDevice::SetAudioAnalog Unable to set audiomode!\n"; + esyslog("dxr3: unable to set digital PCM audio mode: %m"); } if (prevMode == EM8300_AUDIOMODE_DIGITALAC3) { @@ -239,7 +238,7 @@ void cDxr3Interface::SetAudioDigitalAC3() m_audioMode = ioval = EM8300_AUDIOMODE_DIGITALAC3; if (ioctl(m_fdControl, EM8300_IOCTL_SET_AUDIOMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3AbsDevice::SetAudioAnalog Unable to set audiomode!\n"; + esyslog("dxr3: unable to set AC3 audio mode: %m"); } ReOpenAudio(); } @@ -260,7 +259,7 @@ void cDxr3Interface::SetAudioSpeed(uint32_t speed) { if (ioctl(m_fdAudio, SNDCTL_DSP_SPEED, &speed) < 0) { - cLog::Instance() << "cDxr3Interface::SetAudioSpeed Unable to set dsp speed\n"; + esyslog("dxr3: unable to set DSP speed to %d: %m", speed); } } } @@ -280,7 +279,8 @@ void cDxr3Interface::SetChannelCount(uint32_t count) { if (ioctl(m_fdAudio, SNDCTL_DSP_STEREO, &count) < 0) { - cLog::Instance() << "cDxr3AbsDevice::SetChannelCount Unable to set channel count\n"; + esyslog("dxr3: unable to set channel count to %d: %m", + count); } } } @@ -294,9 +294,10 @@ void cDxr3Interface::SetAudioSampleSize(uint32_t sampleSize) { if (!m_ExternalReleased) { - if (ioctl(m_fdAudio, SNDCTL_DSP_SAMPLESIZE, sampleSize)) + if (ioctl(m_fdAudio, SNDCTL_DSP_SAMPLESIZE, sampleSize) < 0) { - cLog::Instance() <<"cDxr3AbsDevice::SetAudioSampleSize Unable to set audio sample size\n"; + esyslog("dxr3: unable to set audio sample size to %d: %m", + sampleSize); } } m_audioSampleSize = sampleSize; @@ -365,7 +366,7 @@ void cDxr3Interface::EnableSPU() m_spuMode = ioval = EM8300_SPUMODE_ON; if (ioctl(m_fdControl, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::EnableSPU Unable to set subpicture mode!\n"; + esyslog("dxr3: unable to enable subpicture mode: %m"); } } @@ -384,7 +385,7 @@ void cDxr3Interface::DisableSPU() m_spuMode = ioval = EM8300_SPUMODE_OFF; if (ioctl(m_fdControl, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::DisableSPU Unable to set subpicture mode!\n"; + esyslog("dxr3: unable to disable subpicture mode: %m"); } } @@ -428,7 +429,7 @@ void cDxr3Interface::EnableOverlay() if (ioctl(m_fdControl, EM8300_IOCTL_OVERLAY_SIGNALMODE, &ioval) < 0) { //###### - cLog::Instance() << "Signalmode failed\n"; + esyslog("dxr3: unable to set overlay signal mode: %m"); return; } @@ -440,7 +441,7 @@ void cDxr3Interface::EnableOverlay() if (ioctl(m_fdControl, EM8300_IOCTL_OVERLAY_SETSCREEN, &scr) < 0) { //###### - cLog::Instance() << "Setting up screen failed\n"; + esyslog("dxr3: unable to set up overlay screen: %m"); return; } @@ -454,7 +455,7 @@ void cDxr3Interface::EnableOverlay() if (ioctl(m_fdControl, EM8300_IOCTL_OVERLAY_SETWINDOW, &win) < 0) { //###### - cLog::Instance() << "Setting up window failed\n"; + esyslog("dxr3: unable to set up overlay window: %m"); return; } @@ -484,7 +485,7 @@ uint32_t cDxr3Interface::GetAspectRatio() const { if (ioctl(m_fdControl, EM8300_IOCTL_GET_ASPECTRATIO, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::GetAspectRatio Unable to get aspect ratio\n"; + esyslog("dxr3: unable to get aspect ratio: %m"); } } @@ -512,7 +513,7 @@ void cDxr3Interface::SetAspectRatio(uint32_t ratio) requestCounter = 0; if (ioctl(m_fdControl, EM8300_IOCTL_SET_ASPECTRATIO, &ratio) < 0) { - cLog::Instance() << "cDxr3Interface::SetAspectRatio Unable to set aspect ratio\n"; + esyslog("dxr3: unable to set aspect ratio: %m"); } else { @@ -555,7 +556,7 @@ void cDxr3Interface::SetPlayMode() ioval = EM8300_PLAYMODE_PLAY; if (ioctl(m_fdControl, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::SetPlayMode Unable to set playmode!\n"; + esyslog("dxr3: unable to set play mode: %m"); } reg.microcode_register = 1; reg.reg = 0; @@ -563,7 +564,7 @@ void cDxr3Interface::SetPlayMode() if (ioctl(m_fdControl, EM8300_IOCTL_WRITEREG, ®) < 0) { - cLog::Instance() << "cDxr3Interface::SetPlayMode Unable to start em8300 sync engine\n"; + esyslog("dxr3: unable to start em8300 sync engine: %m"); } } @@ -580,7 +581,7 @@ void cDxr3Interface::Pause() { if (ioctl(m_fdControl, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::Pause Unable to set playmode!\n"; + esyslog("dxr3: unable to set pause mode: %m"); } } @@ -596,7 +597,7 @@ void cDxr3Interface::SingleStep() { if (ioctl(m_fdControl, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - cLog::Instance() << "cDxr3Interface::SingleStep Unable to set playmode!\n"; + esyslog("dxr3: unable to set single-step mode: %m"); } } @@ -619,7 +620,7 @@ void cDxr3Interface::PlayVideoFrame(cFixedLengthFrame* pFrame, int times) { if (times > 1) { - cLog::Instance() << "times: " << times << "\n"; + dsyslog("dxr3: playvideoframe: times=%d", times); } while (written < pFrame->GetCount() && count >= 0) @@ -699,7 +700,8 @@ void cDxr3Interface::PlayAudioFrame(uint8_t* pBuf, int length) if ((written = write(m_fdAudio, pBuf, length) < 0)) Resuscitation(); if (written != length) { - cLog::Instance() << "cDxr3Interface::PlayAudioFrame(uint8_t* pBuf, int length): Not written = " << length - written << "\n"; + esyslog("dxr3: unable to play whole audio frame, skipped %d bytes", + length - written); } } @@ -805,7 +807,8 @@ void cDxr3Interface::ExternalReopenDevices() m_pClock = new cDxr3SysClock(m_fdControl, m_fdVideo, m_fdSpu); if (!m_pClock) { - cLog::Instance() << "Unable to allocate memory for m_pClock in cDxr3Interface\n"; + esyslog("dxr3: fatal: failed to allocate memory for em8300" + " system clock in reopen"); exit(1); } @@ -881,12 +884,6 @@ void cDxr3Interface::ReOpenAudio() //! uploadroutine for microcode void cDxr3Interface::UploadMicroCode() { - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Interface::UploadMicroCode: uploading from " - << MICROCODE << "..."; - } - em8300_microcode_t em8300_microcode; struct stat s; @@ -896,14 +893,15 @@ void cDxr3Interface::UploadMicroCode() if (UCODE <0) { - cLog::Instance() << "Unable to open microcode file " - << MICROCODE << " for reading\n"; + esyslog("dxr3: fatal: unable to open microcode file %s: %m", + MICROCODE); exit(1); } if (fstat(UCODE, &s ) <0) { - cLog::Instance() << "Unable to fstat ucode file\n"; + esyslog("dxr3: fatal: unable to fstat microcode file %s: %m", + MICROCODE); exit(1); } @@ -911,13 +909,14 @@ void cDxr3Interface::UploadMicroCode() em8300_microcode.ucode = new char[s.st_size]; if (em8300_microcode.ucode == NULL) { - cLog::Instance() << "Unable to malloc() space for ucode\n"; + esyslog("dxr3: fatal: unable to malloc() space for microcode"); exit(1); } if (read(UCODE,em8300_microcode.ucode,s.st_size) < 1) { - cLog::Instance() << "Unable to read data from microcode file\n"; + esyslog("dxr3: fatal: unable to read microcode file %s: %m", + MICROCODE); // free memory to avoid memory leak delete [] (char*) em8300_microcode.ucode; exit(1); @@ -930,7 +929,7 @@ void cDxr3Interface::UploadMicroCode() // upload it if( ioctl(m_fdControl, EM8300_IOCTL_INIT, &em8300_microcode) == -1) { - cLog::Instance() << "Microcode upload to failed!! \n"; + esyslog("dxr3: fatal: microcode upload failed: %m"); // free memory to avoid memory leak delete [] (char*) em8300_microcode.ucode; exit(1); @@ -938,11 +937,6 @@ void cDxr3Interface::UploadMicroCode() // free memory to avoid memory leak delete [] (char*) em8300_microcode.ucode; - - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "...done\n"; - } } // ================================== @@ -954,44 +948,32 @@ void cDxr3Interface::ConfigureDevice() // set video mode if (cDxr3ConfigData::Instance().GetVideoMode() == PAL) { + dsyslog("dxr3: configure: video mode: PAL"); videomode = EM8300_VIDEOMODE_PAL; - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Interface::ConfigureDevice: Videomode = PAL\n"; - } } else if (cDxr3ConfigData::Instance().GetVideoMode() == PAL60) { + dsyslog("dxr3: configure: video mode: PAL60"); videomode = EM8300_VIDEOMODE_PAL60; - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Interface::ConfigureDevice: Videomode = PAL60\n"; - } } else { + dsyslog("dxr3: configure: video mode: NTSC"); videomode = EM8300_VIDEOMODE_NTSC; - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Interface::ConfigureDevice: Videomode = NTSC\n"; - } } // make ioctl if (ioctl(m_fdControl, EM8300_IOCTL_SET_VIDEOMODE, &videomode) == -1) { - cLog::Instance() << "Unable to set videomode\n"; + esyslog("dxr3: fatal: unable to set video mode: %m"); exit(1); } // set audio mode if (!cDxr3ConfigData::Instance().GetUseDigitalOut()) { + dsyslog("dxr3: configure: audio mode: analog"); SetAudioAnalog(); - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3Interface::ConfigureDevice: Audiomode = Analog\n"; - } } } @@ -1002,23 +984,23 @@ void cDxr3Interface::Resuscitation() time_t startt = time(&startt); time_t endt = 0; m_ExternalReleased = true; - dsyslog("cDxr3Interface::Resuscitation Device failure detected"); + + dsyslog("dxr3: resuscitation: device failure or user initiated reset"); UploadMicroCode(); - dsyslog("cDxr3Interface::Resuscitation Microcode upload successful"); //NonBlockingCloseOpen(); m_ExternalReleased = false; endt = time(&endt); - dsyslog("cDxr3Interface::Resuscitation Reopening devices took %d", - (int)(endt - startt)); - if (endt - startt > 4) { + esyslog("dxr3: fatal: reopening devices took too long"); exit(1); } + dsyslog("dxr3: resuscitation: reopening devices took %ld seconds", + endt - startt); ConfigureDevice(); } @@ -1141,7 +1123,7 @@ void cDxr3Interface::ResetHardware() { Lock(); - cLog::Instance() << "cDxr3Interface: Resetting DXR3 hardware\n"; + isyslog("dxr3: hardware reset requested"); Resuscitation(); Unlock(); @@ -1156,7 +1138,7 @@ void cDxr3Interface::SetBrightness(int value) if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0) { - cLog::Instance() << "cDxr3Interface::SetBrightness: Unable to set brightness to " << value << "\n"; + esyslog("dxr3: unable to set brightness to %d: %m", value); } } @@ -1168,7 +1150,7 @@ void cDxr3Interface::SetContrast(int value) if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0) { - cLog::Instance() << "cDxr3Interface::SetContrast: Unable to set contrast to " << value << "\n"; + esyslog("dxr3: unable to set contrast to %d: %m", value); } } @@ -1180,7 +1162,7 @@ void cDxr3Interface::SetSaturation(int value) if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0) { - cLog::Instance() << "cDxr3Interface::SetSaturation: Unable to set saturation to " << value << "\n"; + esyslog("dxr3: unable to set saturation to %d: %m", value); } } diff --git a/dxr3interface.h b/dxr3interface.h index 3d8226b..884d517 100644 --- a/dxr3interface.h +++ b/dxr3interface.h @@ -30,7 +30,6 @@ #include <sys/ioctl.h> #include "dxr3vdrincludes.h" -#include "dxr3log.h" #include "dxr3configdata.h" #include "dxr3sysclock.h" diff --git a/dxr3interface_spu_encoder.c b/dxr3interface_spu_encoder.c index 3434eb1..1129dce 100644 --- a/dxr3interface_spu_encoder.c +++ b/dxr3interface_spu_encoder.c @@ -308,19 +308,12 @@ int cSPUEncoder::Flush(cPalette *Palette) // calculate osd size (actually dead code) CalculateActiveOsdArea(); - /* - cLog::Instance() << "(" << m_x0 << ", " << m_x1 << ") - (" - << m_y0 << ", " << m_y1 << ")"; - */ - m_encodeddata.count = 0; EncodePixelbufRle(0, 0, OSDWIDTH, OSDHEIGHT-1, OSD_Screen, 0, &m_encodeddata); - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "OSD Datasize: " << m_encodeddata.count << "\n"; - } + dsyslog("dxr3: cSPUEncoder::Flush: OSD data size: %d", + m_encodeddata.count); if (m_encodeddata.count <= DATASIZE) { @@ -330,8 +323,8 @@ int cSPUEncoder::Flush(cPalette *Palette) } else { - cLog::Instance() << "Warning: SPU data (" << m_encodeddata.count - << ") size exceeds limit\n"; + esyslog("dxr3: spu: warning: SPU data size (%d) exceeds limit (%d)", + m_encodeddata.count, DATASIZE); return -1; } } diff --git a/dxr3log.c b/dxr3log.c deleted file mode 100644 index 61cb3ef..0000000 --- a/dxr3log.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * dxr3log.c - * - * Copyright (C) 2004 Christian Gmeiner - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "dxr3log.h" - -// ================================== -//! constructor -cLog::cLog() -{ - m_LogOpen = false; - m_ForeFlush = true; - - std::string Filename; - Filename = LOGPATH; - Filename += "dxr3plugin.log"; - - Open(Filename); -} - -// ================================== -//! constructor with filename -cLog::cLog(std::string Filename) -{ - m_LogOpen = false; - m_ForeFlush = true; - - Open(Filename); -} - -// ================================== -//! open log file -void cLog::Open(std::string Filename) -{ - m_LogStream.open(Filename.c_str()); - m_LogOpen = true; -} - -// ================================== -//! close log file -void cLog::Close() -{ - if (m_LogOpen) - { - // close file now - m_LogStream.flush(); - m_LogStream.close(); - - m_LogOpen = false; - } -} - -// Local variables: -// mode: c++ -// c-file-style: "stroustrup" -// c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t -// End: diff --git a/dxr3log.h b/dxr3log.h deleted file mode 100644 index 5cb78ec..0000000 --- a/dxr3log.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * dxr3log.h - * - * Copyright (C) 2004 Christian Gmeiner - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _DXR3_LOG_H_ -#define _DXR3_LOG_H_ - -#include <fstream> -#include <string> -#include "dxr3singleton.h" - -// ================================== -//! A log class. -/*! - With this nice util dxr3plugin generates and mange a log file. In this - file the developer/enduser can find informations and can find errors, - problems and ohter stuff. -*/ -class cLog : public Singleton<cLog> -{ -public: - cLog(); // use default log file - cLog(std::string FileName); - - ~cLog() - { - Close(); - } - - void SetForceFlush(const bool v) - { - m_ForeFlush = v; - } - bool GetForceFlush() const - { - return m_ForeFlush; - } - - // write type data to log file. - template <class Type> - inline cLog& operator << ( Type item ) - { - if (m_LogOpen) - { - m_LogStream << item; - if (m_ForeFlush) - m_LogStream.flush(); - } - return *this; - } - inline cLog& operator << ( size_t item ) - { - if (m_LogOpen) - { - m_LogStream << (unsigned int)item; - if (m_ForeFlush) - m_LogStream.flush(); - } - return *this; - } - inline cLog& operator << ( bool item ) - { - if (m_LogOpen) - { - if (item == true) - m_LogStream << "true"; - else - m_LogStream << "false"; - if (m_ForeFlush) - m_LogStream.flush(); - } - return *this; - } - -private: - std::ofstream m_LogStream; ///< Our logstream - bool m_LogOpen; ///< Is log open? - bool m_ForeFlush; ///< Do we want to flush log everytime? - - void Open(std::string Filename); // with this function we open our logfile - void Close(); // with this function we close our logfile -}; - -#endif /*_DXR3_LOG_H_*/ - -// Local variables: -// mode: c++ -// c-file-style: "stroustrup" -// c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t -// End: diff --git a/dxr3multichannelaudio.c b/dxr3multichannelaudio.c index 1d1bc30..abab4b8 100644 --- a/dxr3multichannelaudio.c +++ b/dxr3multichannelaudio.c @@ -8,7 +8,6 @@ #include <malloc.h> #include "dxr3multichannelaudio.h" -#include "dxr3log.h" #include <vdr/ringbuffer.h> //#define DEBUG(x...) printf(x) diff --git a/dxr3outputthread.c b/dxr3outputthread.c index 8d6d311..d11d2bd 100644 --- a/dxr3outputthread.c +++ b/dxr3outputthread.c @@ -23,7 +23,6 @@ #include <unistd.h> #include <time.h> #include "dxr3outputthread.h" -#include "dxr3log.h" // ================================== const int AUDIO_OFFSET = 4500; @@ -87,8 +86,6 @@ void cDxr3AudioOutThread::Action() bool resync = false; uint32_t pts = 0; - cLog::Instance() << "cDxr3AudioOutThread::Action Thread started\n"; - while (!GetStopSignal()) { pts = 0; @@ -172,8 +169,6 @@ void cDxr3VideoOutThread::Action() uint32_t pts = 0; static uint32_t lastPts = 0; - cLog::Instance() << "cDxr3VideoOutThread::Action Thread started\n"; - while (!GetStopSignal()) { cFixedLengthFrame* pNext = m_buffer.Get(); diff --git a/dxr3pesframe.c b/dxr3pesframe.c index 746879b..e33a846 100644 --- a/dxr3pesframe.c +++ b/dxr3pesframe.c @@ -20,13 +20,13 @@ */ #include "dxr3pesframe.h" -#include "dxr3log.h" #include <linux/em8300.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <vdr/tools.h> // ================================== bool cDxr3PesFrame::ExtractNextFrame(const uint8_t* pBuf, uint32_t length) @@ -128,7 +128,7 @@ bool cDxr3PesFrame::ExtractNextFrame(const uint8_t* pBuf, uint32_t length) catch (cDxr3SafeArray<uint8_t>::eSafeArrayException ex) { m_bValid = false; - cLog::Instance() << "*** PES_GENERAL_ERROR ****\n"; + esyslog("dxr3: general PES error"); throw(PES_GENERAL_ERROR); } diff --git a/dxr3spudecoder.c b/dxr3spudecoder.c index 1417392..373bedf 100644 --- a/dxr3spudecoder.c +++ b/dxr3spudecoder.c @@ -30,7 +30,6 @@ #include "dxr3spudecoder.h" #include "dxr3interface.h" #include "dxr3tools.h" -#include "dxr3log.h" // ================================== #define CMD_SPU_MENU 0x00 @@ -173,14 +172,8 @@ bool cDxr3SpuBitmap::getMinSize(const aDxr3SpuPalDescr paldescr, ret = true; } } - /* - if (ret && cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuBitmap::getMinSize: (" - << size.x1 ", " << size.y1 << ") x (" - << size.x2 << ", " << size.y2 << ")\n"; - } - */ + dsyslog("dxr3: getminsize: (%d,%d) x (%d,%d)", + size.x1, size.y1, size.x2, size.y2); if (size.x1 > size.x2 || size.y1 > size.y2) return false; return ret; @@ -288,12 +281,7 @@ void cDxr3SpuDecoder::processSPU(uint32_t pts, uint8_t * buf) #endif { setTime(pts); - - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::processSPU: SPU pushData: pts: " - << pts << "\n"; - } + dsyslog("dxr3: spudec push: pts=%d", pts); delete spubmp; spubmp = NULL; @@ -349,11 +337,7 @@ void cDxr3SpuDecoder::setHighlight(uint16_t sx, uint16_t sy, uint16_t ex, uint16 if (ne) { - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setHighlight: " << sx - << ", " << sy << ", " << ex << ", " << ey << "\n"; - } + dsyslog("dxr3: spu highlight: %d, %d, %d, %d", sx, sy, ex, ey); hlpsize.x1 = sx; hlpsize.y1 = sy; @@ -456,11 +440,7 @@ void cDxr3SpuDecoder::Draw() if (osd == NULL) if ((osd = cOsdProvider::NewOsd(0, 0)) == NULL) { - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::Draw: New OSD faild!\n"; - } - dsyslog("NewOsd failed\n"); + esyslog("dxr3: could not instantiate new OSD"); return; } @@ -548,20 +528,14 @@ int cDxr3SpuDecoder::setTime(uint32_t pts) { case CMD_SPU_SHOW: // show subpicture - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setTime: show subpicture\n"; - } + dsyslog("dxr3: spu show"); state = spSHOW; i++; break; case CMD_SPU_HIDE: // hide subpicture - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setTime: hide subpicture\n"; - } + dsyslog("dxr3: spu hide"); state = spHIDE; i++; break; @@ -592,13 +566,8 @@ int cDxr3SpuDecoder::setTime(uint32_t pts) size.y1 = (spu[i + 4] << 4) | (spu[i + 5] >> 4); size.y2 = ((spu[i + 5] & 0x0f) << 8) | spu[i + 6]; - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setTime: (" - << size.x1 << ", " << size.y1 - << ") x (" << size.x2 << ", " - << size.y2 <<")\n"; - } + dsyslog("dxr3: spu size (%d,%d) x (%d,%d)", + size.x1, size.y1, size.x2, size.y2); i += 7; break; @@ -607,12 +576,7 @@ int cDxr3SpuDecoder::setTime(uint32_t pts) fodd = spuU32(i + 1); feven = spuU32(i + 3); - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setTime: odd = " - << fodd << " even = " << feven - << "\n"; - } + dsyslog("dxr3: spu offset: odd=%d, even=%d", fodd, feven); i += 5; break; @@ -624,17 +588,13 @@ int cDxr3SpuDecoder::setTime(uint32_t pts) break; case CMD_SPU_MENU: - if (cDxr3ConfigData::Instance().GetDebug()) - { - cLog::Instance() << "cDxr3SpuDecoder::setTime: spu menu\n"; - } + dsyslog("dxr3: spu menu"); state = spMENU; - i++; break; default: - esyslog("invalid sequence in control header (%.2x)\n", + esyslog("dxr3: invalid sequence in control header (%.2x)", spu[i]); assert(0); i++; diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c index 490f9b6..496a0c0 100644 --- a/dxr3syncbuffer.c +++ b/dxr3syncbuffer.c @@ -62,7 +62,7 @@ void cFixedLengthFrame::Init(uint32_t lenght) // allocation ok? if (!m_pData) { - cLog::Instance() << "Failed to allocate memory in cFixedLengthFrame (m_pData) - will stop now"; + esyslog("dxr3: fatal: unable to allocate memory for new frame"); exit(1); } } @@ -123,7 +123,7 @@ cDxr3SyncBuffer::cDxr3SyncBuffer(int frameCount, int frameLength, // got we a valid m_pBuffer? if (!m_pBuffer) { - cLog::Instance() << "Failed to allocate memory in cDxr3SyncBuffer (m_pBuffer) - will stop now"; + esyslog("dxr3: fatal: unable to allocate memory for new frame"); exit(1); } @@ -204,8 +204,7 @@ bool cDxr3SyncBuffer::Poll(int TimeoutMs) d_us = tv.tv_usec - tv_start.tv_usec; ms = d_s * 1000 + d_us / 1000; if (ms > TimeoutMs * 2) { - cLog::Instance() << "Secondary timeout\n"; - printf("Secondary timeout\n"); + esyslog("dxr3: sync: secondary timeout"); break; } } @@ -247,8 +246,7 @@ cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint d_us = tv.tv_usec - tv_start.tv_usec; ms = d_s * 1000 + d_us / 1000; if (ms > 2000) { - cLog::Instance() << "Push timeout\n"; - printf("Push timeout\n"); + esyslog("dxr3: sync: push timeout"); return NULL; } } @@ -275,11 +273,7 @@ cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint if (m_nextFree == m_next) { - cLog::Instance() << "Buffer overrun\n"; - //cLog::Instance() << "cDxr3SyncBuffer::Push m_demuxMode: " << (int)m_demuxMode << endl; - //cLog::Instance() << "cDxr3SyncBuffer::Push Available(): " << Available() << endl; - //cLog::Instance() << "cDxr3SyncBuffer::Push Size(): " << Size() << endl; - + esyslog("dxr3: sync: push buffer overrun"); Clear(); // XXX This is only a workaround until a sufficient control algorithm is implemented throw(SYNC_BUFFER_OVERRUN); } diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h index b1d2912..b019faf 100644 --- a/dxr3syncbuffer.h +++ b/dxr3syncbuffer.h @@ -28,7 +28,6 @@ #include "dxr3interface.h" #include "dxr3generaldefines.h" #include "dxr3nextpts.h" -#include "dxr3log.h" // ================================== const uint32_t UNKNOWN_CHANNEL_COUNT = 0xFFFFFFFF; |