mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
- rename lt_debug => hal_debug; it's not only libtriple debugging
Signed-off-by: Thilo Graf <dbt@novatux.de> - debuglevel fixed
This commit is contained in:
@@ -22,54 +22,54 @@
|
||||
|
||||
#include "audio_lib.h"
|
||||
#include "dmx_hal.h"
|
||||
#include "lt_debug.h"
|
||||
#include "hal_debug.h"
|
||||
|
||||
#define lt_debug(args...) _lt_debug(HAL_DEBUG_AUDIO, this, args)
|
||||
#define lt_info(args...) _lt_info(HAL_DEBUG_AUDIO, this, args)
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_AUDIO, this, args)
|
||||
|
||||
cAudio * audioDecoder = NULL;
|
||||
|
||||
cAudio::cAudio(void *, void *, void *)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
}
|
||||
|
||||
cAudio::~cAudio(void)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
}
|
||||
|
||||
void cAudio::openDevice(void)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
}
|
||||
|
||||
void cAudio::closeDevice(void)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
}
|
||||
|
||||
int cAudio::do_mute(bool enable, bool remember)
|
||||
{
|
||||
lt_debug("%s(%d, %d)\n", __func__, enable, remember);
|
||||
hal_debug("%s(%d, %d)\n", __func__, enable, remember);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cAudio::setVolume(unsigned int left, unsigned int right)
|
||||
{
|
||||
lt_debug("%s(%d, %d)\n", __func__, left, right);
|
||||
hal_debug("%s(%d, %d)\n", __func__, left, right);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cAudio::Start(void)
|
||||
{
|
||||
lt_debug("%s >\n", __func__);
|
||||
hal_debug("%s >\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cAudio::Stop(void)
|
||||
{
|
||||
lt_debug("%s >\n", __func__);
|
||||
hal_debug("%s >\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -80,12 +80,12 @@ bool cAudio::Pause(bool /*Pcm*/)
|
||||
|
||||
void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, Mode);
|
||||
hal_debug("%s %d\n", __func__, Mode);
|
||||
};
|
||||
|
||||
void cAudio::SetStreamType(AUDIO_FORMAT type)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, type);
|
||||
hal_debug("%s %d\n", __func__, type);
|
||||
};
|
||||
|
||||
int cAudio::setChannel(int /*channel*/)
|
||||
@@ -95,19 +95,19 @@ int cAudio::setChannel(int /*channel*/)
|
||||
|
||||
int cAudio::PrepareClipPlay(int ch, int srate, int bits, int le)
|
||||
{
|
||||
lt_debug("%s ch %d srate %d bits %d le %d\n", __func__, ch, srate, bits, le);;
|
||||
hal_debug("%s ch %d srate %d bits %d le %d\n", __func__, ch, srate, bits, le);;
|
||||
return 0;
|
||||
};
|
||||
|
||||
int cAudio::WriteClip(unsigned char *buffer, int size)
|
||||
{
|
||||
lt_debug("cAudio::%s buf 0x%p size %d\n", __func__, buffer, size);
|
||||
hal_debug("cAudio::%s buf 0x%p size %d\n", __func__, buffer, size);
|
||||
return size;
|
||||
};
|
||||
|
||||
int cAudio::StopClip()
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
return 0;
|
||||
};
|
||||
|
||||
@@ -118,36 +118,36 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m
|
||||
freq = 0;
|
||||
bitrate = 0; /* not used, but easy to get :-) */
|
||||
mode = 0; /* default: stereo */
|
||||
lt_debug("%s t: %d l: %d f: %d b: %d m: %d\n",
|
||||
hal_debug("%s t: %d l: %d f: %d b: %d m: %d\n",
|
||||
__func__, type, layer, freq, bitrate, mode);
|
||||
};
|
||||
|
||||
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
};
|
||||
|
||||
void cAudio::SetHdmiDD(bool enable)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, enable);
|
||||
hal_debug("%s %d\n", __func__, enable);
|
||||
};
|
||||
|
||||
void cAudio::SetSpdifDD(bool enable)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, enable);
|
||||
hal_debug("%s %d\n", __func__, enable);
|
||||
};
|
||||
|
||||
void cAudio::ScheduleMute(bool On)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, On);
|
||||
hal_debug("%s %d\n", __func__, On);
|
||||
};
|
||||
|
||||
void cAudio::EnableAnalogOut(bool enable)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, enable);
|
||||
hal_debug("%s %d\n", __func__, enable);
|
||||
};
|
||||
|
||||
void cAudio::setBypassMode(bool disable)
|
||||
{
|
||||
lt_debug("%s %d\n", __func__, disable);
|
||||
hal_debug("%s %d\n", __func__, disable);
|
||||
}
|
||||
|
@@ -33,18 +33,18 @@
|
||||
#include <string>
|
||||
#include <sys/ioctl.h>
|
||||
#include "dmx_lib.h"
|
||||
#include "lt_debug.h"
|
||||
#include "hal_debug.h"
|
||||
|
||||
#include "video_lib.h"
|
||||
/* needed for getSTC... */
|
||||
extern cVideo *videoDecoder;
|
||||
|
||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args)
|
||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args)
|
||||
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args)
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_DEMUX, this, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_DEMUX, this, args)
|
||||
#define hal_info_c(args...) _hal_info(HAL_DEBUG_DEMUX, NULL, args)
|
||||
|
||||
#define dmx_err(_errfmt, _errstr, _revents) do { \
|
||||
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
|
||||
hal_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
|
||||
__func__, _errstr, fd, _revents, DMX_T[dmx_type], pid, flt); \
|
||||
} while(0);
|
||||
|
||||
@@ -78,7 +78,7 @@ cDemux::cDemux(int n)
|
||||
{
|
||||
if (n < 0 || n > 2)
|
||||
{
|
||||
lt_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
|
||||
hal_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
|
||||
num = 0;
|
||||
}
|
||||
else
|
||||
@@ -88,7 +88,7 @@ cDemux::cDemux(int n)
|
||||
|
||||
cDemux::~cDemux()
|
||||
{
|
||||
lt_debug("%s #%d fd: %d\n", __FUNCTION__, num, fd);
|
||||
hal_debug("%s #%d fd: %d\n", __FUNCTION__, num, fd);
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
|
||||
int devnum = num;
|
||||
int flags = O_RDWR|O_CLOEXEC;
|
||||
if (fd > -1)
|
||||
lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
|
||||
hal_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
|
||||
|
||||
dmx_type = pes_type;
|
||||
if (pes_type != DMX_PSI_CHANNEL)
|
||||
@@ -106,10 +106,10 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
|
||||
fd = open(devname[devnum], flags);
|
||||
if (fd < 0)
|
||||
{
|
||||
lt_info("%s %s: %m\n", __FUNCTION__, devname[devnum]);
|
||||
hal_info("%s %s: %m\n", __FUNCTION__, devname[devnum]);
|
||||
return false;
|
||||
}
|
||||
lt_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
|
||||
hal_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
|
||||
num, DMX_T[pes_type], pes_type, uBufferSize, fd);
|
||||
|
||||
if (dmx_type == DMX_VIDEO_CHANNEL)
|
||||
@@ -119,18 +119,18 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
|
||||
#if 0
|
||||
if (!pesfds.empty())
|
||||
{
|
||||
lt_info("%s ERROR! pesfds not empty!\n", __FUNCTION__); /* TODO: error handling */
|
||||
hal_info("%s ERROR! pesfds not empty!\n", __FUNCTION__); /* TODO: error handling */
|
||||
return false;
|
||||
}
|
||||
int n = DMX_SOURCE_FRONT0;
|
||||
if (ioctl(fd, DMX_SET_SOURCE, &n) < 0)
|
||||
lt_info("%s DMX_SET_SOURCE %d failed! (%m)\n", __func__, n);
|
||||
hal_info("%s DMX_SET_SOURCE %d failed! (%m)\n", __func__, n);
|
||||
#endif
|
||||
if (uBufferSize > 0)
|
||||
{
|
||||
/* probably uBufferSize == 0 means "use default size". TODO: find a reasonable default */
|
||||
if (ioctl(fd, DMX_SET_BUFFER_SIZE, uBufferSize) < 0)
|
||||
lt_info("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
|
||||
hal_info("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
|
||||
}
|
||||
buffersize = uBufferSize;
|
||||
|
||||
@@ -139,10 +139,10 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
|
||||
|
||||
void cDemux::Close(void)
|
||||
{
|
||||
lt_debug("%s #%d, fd = %d\n", __FUNCTION__, num, fd);
|
||||
hal_debug("%s #%d, fd = %d\n", __FUNCTION__, num, fd);
|
||||
if (fd < 0)
|
||||
{
|
||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void cDemux::Close(void)
|
||||
dmx_tp_count--;
|
||||
if (dmx_tp_count < 0)
|
||||
{
|
||||
lt_info("%s dmx_tp_count < 0!!\n", __func__);
|
||||
hal_info("%s dmx_tp_count < 0!!\n", __func__);
|
||||
dmx_tp_count = 0;
|
||||
}
|
||||
}
|
||||
@@ -163,10 +163,10 @@ void cDemux::Close(void)
|
||||
|
||||
bool cDemux::Start(bool)
|
||||
{
|
||||
lt_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
|
||||
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
|
||||
if (fd < 0)
|
||||
{
|
||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
return false;
|
||||
}
|
||||
ioctl(fd, DMX_START);
|
||||
@@ -175,10 +175,10 @@ bool cDemux::Start(bool)
|
||||
|
||||
bool cDemux::Stop(void)
|
||||
{
|
||||
lt_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
|
||||
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
|
||||
if (fd < 0)
|
||||
{
|
||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||
return false;
|
||||
}
|
||||
ioctl(fd, DMX_STOP);
|
||||
@@ -207,7 +207,7 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
|
||||
else if (rc < 0)
|
||||
{
|
||||
dmx_err("poll: %s,", strerror(errno), 0)
|
||||
//lt_info("%s poll: %m\n", __FUNCTION__);
|
||||
//hal_info("%s poll: %m\n", __FUNCTION__);
|
||||
/* happens, when running under gdb... */
|
||||
if (errno == EINTR)
|
||||
goto retry;
|
||||
@@ -251,7 +251,7 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filt
|
||||
|
||||
if (len > DMX_FILTER_SIZE)
|
||||
{
|
||||
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
||||
hal_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
||||
len = DMX_FILTER_SIZE;
|
||||
}
|
||||
flt = filter[0];
|
||||
@@ -343,7 +343,7 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filt
|
||||
if (timeout == 0 && negmask == NULL)
|
||||
s_flt.timeout = to;
|
||||
|
||||
lt_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
|
||||
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
|
||||
pid, fd, DMX_T[dmx_type], len, s_flt.timeout,s_flt.flags, s_flt.filter.filter[0]);
|
||||
#if 0
|
||||
fprintf(stderr,"filt: ");for(int i=0;i<DMX_FILTER_SIZE;i++)fprintf(stderr,"%02hhx ",s_flt.filter.filter[i]);fprintf(stderr,"\n");
|
||||
@@ -371,7 +371,7 @@ bool cDemux::pesFilter(const unsigned short _pid)
|
||||
if ((pid >= 0x0002 && pid <= 0x000f) || pid >= 0x1fff)
|
||||
return false;
|
||||
|
||||
lt_debug("%s #%d pid: 0x%04hx fd: %d type: %s\n", __FUNCTION__, num, pid, fd, DMX_T[dmx_type]);
|
||||
hal_debug("%s #%d pid: 0x%04hx fd: %d type: %s\n", __FUNCTION__, num, pid, fd, DMX_T[dmx_type]);
|
||||
|
||||
memset(&p_flt, 0, sizeof(p_flt));
|
||||
p_flt.pid = pid;
|
||||
@@ -401,7 +401,7 @@ bool cDemux::pesFilter(const unsigned short _pid)
|
||||
p_flt.output = DMX_OUT_TSDEMUX_TAP;
|
||||
break;
|
||||
default:
|
||||
lt_info("%s #%d invalid dmx_type %d!\n", __func__, num, dmx_type);
|
||||
hal_info("%s #%d invalid dmx_type %d!\n", __func__, num, dmx_type);
|
||||
return false;
|
||||
}
|
||||
return (ioctl(fd, DMX_SET_PES_FILTER, &p_flt) >= 0);
|
||||
@@ -409,39 +409,39 @@ bool cDemux::pesFilter(const unsigned short _pid)
|
||||
|
||||
void cDemux::SetSyncMode(AVSYNC_TYPE /*mode*/)
|
||||
{
|
||||
lt_debug("%s #%d\n", __FUNCTION__, num);
|
||||
hal_debug("%s #%d\n", __FUNCTION__, num);
|
||||
}
|
||||
|
||||
void *cDemux::getBuffer()
|
||||
{
|
||||
lt_debug("%s #%d\n", __FUNCTION__, num);
|
||||
hal_debug("%s #%d\n", __FUNCTION__, num);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *cDemux::getChannel()
|
||||
{
|
||||
lt_debug("%s #%d\n", __FUNCTION__, num);
|
||||
hal_debug("%s #%d\n", __FUNCTION__, num);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool cDemux::addPid(unsigned short Pid)
|
||||
{
|
||||
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
||||
hal_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
||||
pes_pids pfd;
|
||||
int ret;
|
||||
if (dmx_type != DMX_TP_CHANNEL)
|
||||
{
|
||||
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||
return false;
|
||||
}
|
||||
if (fd == -1)
|
||||
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
||||
hal_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
||||
pfd.fd = fd; /* dummy */
|
||||
pfd.pid = Pid;
|
||||
pesfds.push_back(pfd);
|
||||
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
||||
if (ret < 0)
|
||||
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
||||
hal_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
||||
return (ret != -1);
|
||||
}
|
||||
|
||||
@@ -449,20 +449,20 @@ void cDemux::removePid(unsigned short Pid)
|
||||
{
|
||||
if (dmx_type != DMX_TP_CHANNEL)
|
||||
{
|
||||
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||
return;
|
||||
}
|
||||
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
||||
{
|
||||
if ((*i).pid == Pid) {
|
||||
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
|
||||
hal_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
|
||||
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
|
||||
lt_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
|
||||
hal_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
|
||||
pesfds.erase(i);
|
||||
return; /* TODO: what if the same PID is there multiple times */
|
||||
}
|
||||
}
|
||||
lt_info("%s pid 0x%04x not found\n", __FUNCTION__, Pid);
|
||||
hal_info("%s pid 0x%04x not found\n", __FUNCTION__, Pid);
|
||||
}
|
||||
|
||||
void cDemux::getSTC(int64_t * STC)
|
||||
@@ -475,7 +475,7 @@ void cDemux::getSTC(int64_t * STC)
|
||||
|
||||
int cDemux::getUnit(void)
|
||||
{
|
||||
lt_debug("%s #%d\n", __FUNCTION__, num);
|
||||
hal_debug("%s #%d\n", __FUNCTION__, num);
|
||||
/* just guessed that this is the right thing to do.
|
||||
right now this is only used by the CA code which is stubbed out
|
||||
anyway */
|
||||
@@ -484,12 +484,12 @@ int cDemux::getUnit(void)
|
||||
|
||||
bool cDemux::SetSource(int unit, int source)
|
||||
{
|
||||
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
||||
hal_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
int cDemux::GetSource(int unit)
|
||||
{
|
||||
lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
|
||||
hal_info_c("%s(%d): not implemented yet\n", __func__, unit);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -24,15 +24,15 @@
|
||||
#include "glfb.h"
|
||||
#include "bcm_host.h"
|
||||
|
||||
#include "lt_debug.h"
|
||||
#include "hal_debug.h"
|
||||
|
||||
#define lt_debug_c(args...) _lt_debug(HAL_DEBUG_INIT, NULL, args)
|
||||
#define lt_info_c(args...) _lt_info(HAL_DEBUG_INIT, NULL, args)
|
||||
#define lt_debug(args...) _lt_debug(HAL_DEBUG_INIT, this, args)
|
||||
#define lt_info(args...) _lt_info(HAL_DEBUG_INIT, this, args)
|
||||
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
|
||||
#define hal_info_c(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, this, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, this, args)
|
||||
|
||||
/* I don't want to assert right now */
|
||||
#define CHECK(x) if (!(x)) { lt_info("GLFB: %s:%d warning: %s\n", __func__, __LINE__, #x); }
|
||||
#define CHECK(x) if (!(x)) { hal_info("GLFB: %s:%d warning: %s\n", __func__, __LINE__, #x); }
|
||||
|
||||
/* TODO: encapsulate this into pdata? */
|
||||
static DISPMANX_RESOURCE_HANDLE_T res[2];
|
||||
@@ -95,7 +95,7 @@ void GLFramebuffer::run()
|
||||
blit_osd();
|
||||
}
|
||||
blit_mutex.unlock();
|
||||
lt_info("GLFB: GL thread stopping\n");
|
||||
hal_info("GLFB: GL thread stopping\n");
|
||||
}
|
||||
|
||||
void GLFramebuffer::blit()
|
||||
@@ -107,13 +107,13 @@ void GLFramebuffer::blit()
|
||||
|
||||
void GLFramebuffer::setup()
|
||||
{
|
||||
lt_info("GLFB: raspi OMX fb setup\n");
|
||||
hal_info("GLFB: raspi OMX fb setup\n");
|
||||
int ret;
|
||||
VC_RECT_T src_rect, dsp_rect; /* source and display size will not change. period. */
|
||||
pitch = ALIGN_UP(width * 4, 32);
|
||||
/* broadcom example code has this ALIGN_UP in there for a reasin, I suppose */
|
||||
if (pitch != width * 4)
|
||||
lt_info("GLFB: WARNING: width not a multiple of 8? I doubt this will work...\n");
|
||||
hal_info("GLFB: WARNING: width not a multiple of 8? I doubt this will work...\n");
|
||||
|
||||
/* global alpha nontransparent (255) */
|
||||
VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE, 255, 0 };
|
||||
@@ -125,7 +125,7 @@ void GLFramebuffer::setup()
|
||||
CHECK(ret == 0);
|
||||
/* 32bit FB depth, *2 because tuxtxt uses a shadow buffer */
|
||||
osd_buf.resize(pitch * height * 2);
|
||||
lt_info("GLFB: Display is %d x %d, FB is %d x %d, memory size %d\n",
|
||||
hal_info("GLFB: Display is %d x %d, FB is %d x %d, memory size %d\n",
|
||||
info.width, info.height, width, height, osd_buf.size());
|
||||
image = &osd_buf[0];
|
||||
/* initialize to half-transparent grey */
|
||||
|
@@ -35,10 +35,10 @@
|
||||
#include <OpenThreads/Thread>
|
||||
|
||||
#include "init.h"
|
||||
#include "lt_debug.h"
|
||||
#include "hal_debug.h"
|
||||
#include "glfb.h"
|
||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
|
||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
|
||||
|
||||
static bool initialized = false;
|
||||
GLFramebuffer *glfb = NULL;
|
||||
@@ -113,11 +113,11 @@ void Input::run()
|
||||
mkfifo("/tmp/neutrino.input", 0600);
|
||||
out_fd = open("/tmp/neutrino.input", O_RDWR|O_CLOEXEC|O_NONBLOCK);
|
||||
if (out_fd < 0)
|
||||
lt_info("could not create /tmp/neutrino.input. good luck. error: %m\n");
|
||||
hal_info("could not create /tmp/neutrino.input. good luck. error: %m\n");
|
||||
|
||||
n = scandir("/dev/input", &namelist, dirfilter, NULL);
|
||||
if (n < 0)
|
||||
lt_info("no input devices /dev/input/eventX??\n");
|
||||
hal_info("no input devices /dev/input/eventX??\n");
|
||||
else
|
||||
{
|
||||
while (n--) {
|
||||
@@ -125,7 +125,7 @@ void Input::run()
|
||||
free(namelist[n]);
|
||||
int fd = open(inputstr, O_RDWR|O_CLOEXEC|O_NONBLOCK);
|
||||
if (fd < 0) {
|
||||
lt_info("could not open %s:%m\n", inputstr);
|
||||
hal_info("could not open %s:%m\n", inputstr);
|
||||
continue;
|
||||
}
|
||||
ioctl(fd, EVIOCGBIT(0, EV_MAX), &bit);
|
||||
@@ -133,7 +133,7 @@ void Input::run()
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
lt_info("input dev: %s bit: 0x%08lx fd: %d\n", inputstr, bit, fd);
|
||||
hal_info("input dev: %s bit: 0x%08lx fd: %d\n", inputstr, bit, fd);
|
||||
in_fds.insert(fd);
|
||||
if (fd > fd_max)
|
||||
fd_max = fd;
|
||||
@@ -155,7 +155,7 @@ void Input::run()
|
||||
if (ret == 0) /* timed out */
|
||||
continue;
|
||||
if (ret < 0) {
|
||||
lt_info("input: select returned %d (%m)\n", ret);
|
||||
hal_info("input: select returned %d (%m)\n", ret);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ void Input::run()
|
||||
if (ret != sizeof(in)) {
|
||||
if (errno == ENODEV) {
|
||||
close(*i);
|
||||
lt_info("input fd %d vanished?\n", *i);
|
||||
hal_info("input fd %d vanished?\n", *i);
|
||||
in_fds.erase(i);
|
||||
}
|
||||
continue;
|
||||
@@ -177,7 +177,7 @@ void Input::run()
|
||||
keymap_t::const_iterator j = kmap.find(in.code);
|
||||
if (j != kmap.end())
|
||||
in.code = j->second;
|
||||
lt_debug("GLFB::%s:(fd %d) pushing 0x%x, value %d\n", __func__, *i, in.code, in.value);
|
||||
hal_debug("GLFB::%s:(fd %d) pushing 0x%x, value %d\n", __func__, *i, in.code, in.value);
|
||||
write(out_fd, &in, sizeof(in));
|
||||
}
|
||||
}
|
||||
@@ -191,8 +191,8 @@ static Input *thread = NULL;
|
||||
void init_td_api()
|
||||
{
|
||||
if (!initialized)
|
||||
lt_debug_init();
|
||||
lt_info("%s begin, initialized=%d, debug=0x%02x\n", __func__, (int)initialized, debuglevel);
|
||||
hal_debug_init();
|
||||
hal_info("%s begin, initialized=%d, debug=0x%02x\n", __func__, (int)initialized, debuglevel);
|
||||
if (! glfb) {
|
||||
int x = 1280, y = 720; /* default OSD FB resolution */
|
||||
/*
|
||||
@@ -207,9 +207,9 @@ void init_td_api()
|
||||
x = atoi(tmp);
|
||||
y = atoi(p + 1);
|
||||
}
|
||||
lt_info("%s: setting Framebuffer size to %dx%d\n", __func__, x, y);
|
||||
hal_info("%s: setting Framebuffer size to %dx%d\n", __func__, x, y);
|
||||
if (!p)
|
||||
lt_info("%s: export GLFB_RESOLUTION=\"<w>,<h>\" to set another resolution\n", __func__);
|
||||
hal_info("%s: export GLFB_RESOLUTION=\"<w>,<h>\" to set another resolution\n", __func__);
|
||||
|
||||
glfb = new GLFramebuffer(x, y); /* hard coded to PAL resolution for now */
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void init_td_api()
|
||||
|
||||
void shutdown_td_api()
|
||||
{
|
||||
lt_info("%s, initialized = %d\n", __func__, (int)initialized);
|
||||
hal_info("%s, initialized = %d\n", __func__, (int)initialized);
|
||||
if (glfb)
|
||||
delete glfb;
|
||||
if (thread)
|
||||
|
@@ -24,17 +24,17 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#include "video_lib.h"
|
||||
#include "lt_debug.h"
|
||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
|
||||
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_VIDEO, NULL, args)
|
||||
#include "hal_debug.h"
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_VIDEO, this, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_VIDEO, this, args)
|
||||
#define hal_info_c(args...) _hal_info(HAL_DEBUG_VIDEO, NULL, args)
|
||||
|
||||
cVideo *videoDecoder = NULL;
|
||||
int system_rev = 0;
|
||||
|
||||
cVideo::cVideo(int, void *, void *, unsigned int)
|
||||
{
|
||||
lt_debug("%s\n", __func__);
|
||||
hal_debug("%s\n", __func__);
|
||||
display_aspect = DISPLAY_AR_16_9;
|
||||
display_crop = DISPLAY_AR_MODE_LETTERBOX;
|
||||
v_format = VIDEO_FORMAT_MPEG2;
|
||||
@@ -46,7 +46,7 @@ cVideo::~cVideo(void)
|
||||
|
||||
int cVideo::setAspectRatio(int vformat, int cropping)
|
||||
{
|
||||
lt_info("%s(%d, %d)\n", __func__, vformat, cropping);
|
||||
hal_info("%s(%d, %d)\n", __func__, vformat, cropping);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ int cVideo::setCroppingMode(int)
|
||||
|
||||
int cVideo::Start(void *, unsigned short, unsigned short, void *)
|
||||
{
|
||||
lt_debug("%s running %d >\n", __func__, thread_running);
|
||||
hal_debug("%s running %d >\n", __func__, thread_running);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cVideo::Stop(bool)
|
||||
{
|
||||
lt_debug("%s running %d >\n", __func__, thread_running);
|
||||
hal_debug("%s running %d >\n", __func__, thread_running);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ int cVideo::SetVideoSystem(int system, bool)
|
||||
h = 720;
|
||||
break;
|
||||
case VIDEO_STD_AUTO:
|
||||
lt_info("%s: VIDEO_STD_AUTO not implemented\n", __func__);
|
||||
hal_info("%s: VIDEO_STD_AUTO not implemented\n", __func__);
|
||||
// fallthrough
|
||||
case VIDEO_STD_SECAM:
|
||||
case VIDEO_STD_PAL:
|
||||
@@ -108,7 +108,7 @@ int cVideo::SetVideoSystem(int system, bool)
|
||||
h = 576;
|
||||
break;
|
||||
default:
|
||||
lt_info("%s: unhandled value %d\n", __func__, system);
|
||||
hal_info("%s: unhandled value %d\n", __func__, system);
|
||||
return 0;
|
||||
}
|
||||
v_std = (VIDEO_STD) system;
|
||||
@@ -127,7 +127,7 @@ void cVideo::SetVideoMode(analog_mode_t)
|
||||
|
||||
void cVideo::ShowPicture(const char *fname)
|
||||
{
|
||||
lt_info("%s(%s)\n", __func__, fname);
|
||||
hal_info("%s(%s)\n", __func__, fname);
|
||||
if (access(fname, R_OK))
|
||||
return;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ int cVideo::SetStreamType(VIDEO_FORMAT v)
|
||||
|
||||
bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video, bool get_osd, bool scale_to_video)
|
||||
{
|
||||
lt_info("%s: data 0x%p xres %d yres %d vid %d osd %d scale %d\n",
|
||||
hal_info("%s: data 0x%p xres %d yres %d vid %d osd %d scale %d\n",
|
||||
__func__, data, xres, yres, get_video, get_osd, scale_to_video);
|
||||
return false;
|
||||
}
|
||||
@@ -185,5 +185,5 @@ int64_t cVideo::GetPTS(void)
|
||||
|
||||
void cVideo::SetDemux(cDemux *)
|
||||
{
|
||||
lt_debug("%s: not implemented yet\n", __func__);
|
||||
hal_debug("%s: not implemented yet\n", __func__);
|
||||
}
|
||||
|
Reference in New Issue
Block a user