mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libtriple: improve lt_debug
* add current instance * shorten lt_debug messages
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
#define AUDIO_DEVICE "/dev/" DEVICE_NAME_AUDIO
|
#define AUDIO_DEVICE "/dev/" DEVICE_NAME_AUDIO
|
||||||
#include "audio_td.h"
|
#include "audio_td.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_AUDIO, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_AUDIO, this, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_AUDIO, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_AUDIO, this, args)
|
||||||
|
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "ca.h"
|
#include "ca.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_CA, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_CA, this, args)
|
||||||
|
|
||||||
|
|
||||||
static cCA *inst = NULL;
|
static cCA *inst = NULL;
|
||||||
@@ -20,7 +20,7 @@ cCA::~cCA()
|
|||||||
|
|
||||||
cCA *cCA::GetInstance()
|
cCA *cCA::GetInstance()
|
||||||
{
|
{
|
||||||
lt_debug("%s\n", __FUNCTION__);
|
_lt_debug(TRIPLE_DEBUG_CA, NULL, "%s\n", __FUNCTION__);
|
||||||
if (inst == NULL)
|
if (inst == NULL)
|
||||||
inst = new cCA();
|
inst = new cCA();
|
||||||
|
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
#include "dmx_td.h"
|
#include "dmx_td.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
|
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args)
|
||||||
|
|
||||||
cDemux *videoDemux = NULL;
|
cDemux *videoDemux = NULL;
|
||||||
cDemux *audioDemux = NULL;
|
cDemux *audioDemux = NULL;
|
||||||
|
@@ -17,8 +17,8 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
|
||||||
|
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
|
@@ -12,17 +12,18 @@ static const char* lt_facility[] = {
|
|||||||
"audio ",
|
"audio ",
|
||||||
"video ",
|
"video ",
|
||||||
"demux ",
|
"demux ",
|
||||||
"record",
|
|
||||||
"play ",
|
"play ",
|
||||||
"power ",
|
"power ",
|
||||||
"init ",
|
"init ",
|
||||||
"ca ",
|
"ca ",
|
||||||
|
"record",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
void _lt_info(int facility, const char *fmt, ...)
|
void _lt_info(int facility, const void *func, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[libtriple:%s] ", lt_facility[facility]);
|
/* %p does print "(nil)" instead of 0x00000000 for NULL */
|
||||||
|
fprintf(stderr, "[LT:%08lx:%s] ", (long) func, lt_facility[facility]);
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
@@ -30,7 +31,7 @@ void _lt_info(int facility, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void _lt_debug(int facility, const char *fmt, ...)
|
void _lt_debug(int facility, const void *func, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
if (debuglevel < 0)
|
if (debuglevel < 0)
|
||||||
fprintf(stderr, "lt_debug: debuglevel not initialized!\n");
|
fprintf(stderr, "lt_debug: debuglevel not initialized!\n");
|
||||||
@@ -38,7 +39,7 @@ void _lt_debug(int facility, const char *fmt, ...)
|
|||||||
if (! ((1 << facility) & debuglevel))
|
if (! ((1 << facility) & debuglevel))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fprintf(stderr, "[libtriple:%s] ", lt_facility[facility]);
|
fprintf(stderr, "[LT:%08lx:%s] ", (long)func, lt_facility[facility]);
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
|
@@ -4,16 +4,16 @@
|
|||||||
#define TRIPLE_DEBUG_AUDIO 0
|
#define TRIPLE_DEBUG_AUDIO 0
|
||||||
#define TRIPLE_DEBUG_VIDEO 1
|
#define TRIPLE_DEBUG_VIDEO 1
|
||||||
#define TRIPLE_DEBUG_DEMUX 2
|
#define TRIPLE_DEBUG_DEMUX 2
|
||||||
#define TRIPLE_DEBUG_RECORD 3
|
#define TRIPLE_DEBUG_PLAYBACK 3
|
||||||
#define TRIPLE_DEBUG_PLAYBACK 4
|
#define TRIPLE_DEBUG_PWRMNGR 4
|
||||||
#define TRIPLE_DEBUG_PWRMNGR 5
|
#define TRIPLE_DEBUG_INIT 5
|
||||||
#define TRIPLE_DEBUG_INIT 6
|
#define TRIPLE_DEBUG_CA 6
|
||||||
#define TRIPLE_DEBUG_CA 7
|
#define TRIPLE_DEBUG_RECORD 7
|
||||||
#define TRIPLE_DEBUG_ALL ((1<<8)-1)
|
#define TRIPLE_DEBUG_ALL ((1<<8)-1)
|
||||||
|
|
||||||
extern int debuglevel;
|
extern int debuglevel;
|
||||||
|
|
||||||
void _lt_debug(int facility, const char *fmt, ...);
|
void _lt_debug(int facility, const void *, const char *fmt, ...);
|
||||||
void _lt_info(int facility, const char *fmt, ...);
|
void _lt_info(int facility, const void *, const char *fmt, ...);
|
||||||
void lt_debug_init(void);
|
void lt_debug_init(void);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -11,8 +11,9 @@
|
|||||||
#include "audio_td.h"
|
#include "audio_td.h"
|
||||||
#include "video_td.h"
|
#include "video_td.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PLAYBACK, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PLAYBACK, this, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, this, args)
|
||||||
|
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, NULL, args)
|
||||||
|
|
||||||
#include <tddevices.h>
|
#include <tddevices.h>
|
||||||
#define DVR "/dev/" DEVICE_NAME_PVR
|
#define DVR "/dev/" DEVICE_NAME_PVR
|
||||||
@@ -345,7 +346,7 @@ void cPlayback::playthread(void)
|
|||||||
|
|
||||||
static void playthread_cleanup_handler(void *)
|
static void playthread_cleanup_handler(void *)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __FUNCTION__);
|
lt_info_c("%s\n", __FUNCTION__);
|
||||||
ioctl(audioDemux->getFD(), DEMUX_SELECT_SOURCE, INPUT_FROM_CHANNEL0);
|
ioctl(audioDemux->getFD(), DEMUX_SELECT_SOURCE, INPUT_FROM_CHANNEL0);
|
||||||
audioDemux->Stop();
|
audioDemux->Stop();
|
||||||
videoDemux->Stop();
|
videoDemux->Stop();
|
||||||
@@ -1456,7 +1457,7 @@ static int mp_syncPES(uint8_t *buf, int len, bool quiet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!quiet && len > 5) /* only warn if enough space was available... */
|
if (!quiet && len > 5) /* only warn if enough space was available... */
|
||||||
lt_info("%s No valid PES signature found. %d Bytes deleted.\n", __FUNCTION__, ret);
|
lt_info_c("%s No valid PES signature found. %d Bytes deleted.\n", __FUNCTION__, ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include <avs/avs_inf.h>
|
#include <avs/avs_inf.h>
|
||||||
|
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PWRMNGR, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PWRMNGR, this, args)
|
||||||
void cCpuFreqManager::Up(void) { lt_debug("%s\n", __FUNCTION__); }
|
void cCpuFreqManager::Up(void) { lt_debug("%s\n", __FUNCTION__); }
|
||||||
void cCpuFreqManager::Down(void) { lt_debug("%s\n", __FUNCTION__); }
|
void cCpuFreqManager::Down(void) { lt_debug("%s\n", __FUNCTION__); }
|
||||||
void cCpuFreqManager::Reset(void) { lt_debug("%s\n", __FUNCTION__); }
|
void cCpuFreqManager::Reset(void) { lt_debug("%s\n", __FUNCTION__); }
|
||||||
|
@@ -37,8 +37,8 @@
|
|||||||
#include <hardware/tddevices.h>
|
#include <hardware/tddevices.h>
|
||||||
#define VIDEO_DEVICE "/dev/" DEVICE_NAME_VIDEO
|
#define VIDEO_DEVICE "/dev/" DEVICE_NAME_VIDEO
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
|
||||||
|
|
||||||
#define fop(cmd, args...) ({ \
|
#define fop(cmd, args...) ({ \
|
||||||
int _r; \
|
int _r; \
|
||||||
|
Reference in New Issue
Block a user