rename lt_debug => hal_debug; it's not only libtriple debugging

Origin commit data
------------------
Branch: master
Commit: ef4ad293cc
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-12-26 (Wed, 26 Dec 2018)

Origin message was:
------------------
- rename lt_debug => hal_debug; it's not only libtriple debugging

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-12-26 00:34:00 +01:00
parent abb5767d1e
commit 81c977318b
48 changed files with 1379 additions and 1387 deletions

View File

@@ -12,11 +12,11 @@
#include "audio_lib.h"
#include "audio_mixer.h"
#include "lt_debug.h"
#include "hal_debug.h"
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_AUDIO, this, args)
#define lt_info(args...) _lt_info(TRIPLE_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)
#include <linux/soundcard.h>
@@ -49,12 +49,12 @@ void cAudio::openDevice(void)
if (fd < 0)
{
if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0)
lt_info("openDevice: open failed (%m)\n");
hal_info("openDevice: open failed (%m)\n");
fcntl(fd, F_SETFD, FD_CLOEXEC);
do_mute(true, false);
}
else
lt_info("openDevice: already open (fd = %d)\n", fd);
hal_info("openDevice: already open (fd = %d)\n", fd);
}
void cAudio::closeDevice(void)
@@ -77,7 +77,7 @@ void cAudio::closeDevice(void)
int cAudio::do_mute(bool enable, bool remember)
{
lt_debug("%s(%d, %d)\n", __FUNCTION__, enable, remember);
hal_debug("%s(%d, %d)\n", __FUNCTION__, enable, remember);
char str[4];
if (remember)
@@ -109,7 +109,7 @@ int map_volume(const int volume)
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);
volume = (left + right) / 2;
int v = map_volume(volume);
@@ -121,7 +121,7 @@ int cAudio::setVolume(unsigned int left, unsigned int right)
tmp = left << 8 | right;
int ret = ioctl(mixer_fd, MIXER_WRITE(mixer_num), &tmp);
if (ret == -1)
lt_info("%s: MIXER_WRITE(%d),%04x: %m\n", __func__, mixer_num, tmp);
hal_info("%s: MIXER_WRITE(%d),%04x: %m\n", __func__, mixer_num, tmp);
return ret;
}
#endif
@@ -153,7 +153,7 @@ 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);
ioctl(fd, AUDIO_SET_AV_SYNC, Mode);
}
@@ -168,7 +168,7 @@ void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
void cAudio::SetStreamType(AUDIO_FORMAT type)
{
int bypass = AUDIO_STREAMTYPE_MPEG;
lt_debug("%s %d\n", __FUNCTION__, type);
hal_debug("%s %d\n", __FUNCTION__, type);
StreamType = type;
switch (type)
@@ -193,12 +193,12 @@ void cAudio::SetStreamType(AUDIO_FORMAT type)
// Normaly the encoding should be set using AUDIO_SET_ENCODING
// But as we implemented the behavior to bypass (cause of e2) this is correct here
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
lt_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__);
hal_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__);
}
int cAudio::setChannel(int channel)
{
lt_debug("%s %d\n", __FUNCTION__, channel);
hal_debug("%s %d\n", __FUNCTION__, channel);
return 0;
}
@@ -208,9 +208,9 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
unsigned int devmask, stereo, usable;
const char *dsp_dev = getenv("DSP_DEVICE");
const char *mix_dev = getenv("MIX_DEVICE");
lt_debug("%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian);
hal_debug("%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian);
if (clipfd > -1) {
lt_info("%s: clipfd already opened (%d)\n", __FUNCTION__, clipfd);
hal_info("%s: clipfd already opened (%d)\n", __FUNCTION__, clipfd);
return -1;
}
mixer_num = -1;
@@ -224,15 +224,15 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
*/
if ((!dsp_dev) || (access(dsp_dev, W_OK))) {
if (dsp_dev)
lt_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
hal_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
" fall back to /dev/dsp1\n", __func__, dsp_dev);
dsp_dev = "/dev/dsp1";
}
lt_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
hal_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
/* the tdoss dsp driver seems to work only on the second open(). really. */
clipfd = open(dsp_dev, O_WRONLY);
if (clipfd < 0) {
lt_info("%s open %s: %m\n", dsp_dev, __FUNCTION__);
hal_info("%s open %s: %m\n", dsp_dev, __FUNCTION__);
return -1;
}
fcntl(clipfd, F_SETFD, FD_CLOEXEC);
@@ -255,21 +255,21 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
mixer_fd = open(mix_dev, O_RDWR);
if (mixer_fd < 0) {
lt_info("%s: open mixer %s failed (%m)\n", __func__, mix_dev);
hal_info("%s: open mixer %s failed (%m)\n", __func__, mix_dev);
/* not a real error */
return 0;
}
if (ioctl(mixer_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
lt_info("%s: SOUND_MIXER_READ_DEVMASK %m\n", __func__);
hal_info("%s: SOUND_MIXER_READ_DEVMASK %m\n", __func__);
devmask = 0;
}
if (ioctl(mixer_fd, SOUND_MIXER_READ_STEREODEVS, &stereo) == -1) {
lt_info("%s: SOUND_MIXER_READ_STEREODEVS %m\n", __func__);
hal_info("%s: SOUND_MIXER_READ_STEREODEVS %m\n", __func__);
stereo = 0;
}
usable = devmask & stereo;
if (usable == 0) {
lt_info("%s: devmask: %08x stereo: %08x, no usable dev :-(\n",
hal_info("%s: devmask: %08x stereo: %08x, no usable dev :-(\n",
__func__, devmask, stereo);
close(mixer_fd);
mixer_fd = -1;
@@ -278,13 +278,13 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
/* __builtin_popcount needs GCC, it counts the set bits... */
if (__builtin_popcount (usable) != 1) {
/* TODO: this code is not yet tested as I have only single-mixer devices... */
lt_info("%s: more than one mixer control: devmask %08x stereo %08x\n"
hal_info("%s: more than one mixer control: devmask %08x stereo %08x\n"
"%s: querying MIX_NUMBER environment variable...\n",
__func__, devmask, stereo, __func__);
const char *tmp = getenv("MIX_NUMBER");
if (tmp)
mixer_num = atoi(tmp);
lt_info("%s: mixer_num is %d -> device %08x\n",
hal_info("%s: mixer_num is %d -> device %08x\n",
__func__, mixer_num, (mixer_num >= 0) ? (1 << mixer_num) : 0);
/* no error checking, you'd better know what you are doing... */
} else {
@@ -302,22 +302,22 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
int cAudio::WriteClip(unsigned char *buffer, int size)
{
int ret;
// lt_debug("cAudio::%s\n", __FUNCTION__);
// hal_debug("cAudio::%s\n", __FUNCTION__);
if (clipfd < 0) {
lt_info("%s: clipfd not yet opened\n", __FUNCTION__);
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
ret = write(clipfd, buffer, size);
if (ret < 0)
lt_info("%s: write error (%m)\n", __FUNCTION__);
hal_info("%s: write error (%m)\n", __FUNCTION__);
return ret;
};
int cAudio::StopClip()
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
if (clipfd < 0) {
lt_info("%s: clipfd not yet opened\n", __FUNCTION__);
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
close(clipfd);
@@ -332,7 +332,7 @@ int cAudio::StopClip()
void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
type = 0;
layer = 0;
freq = 0;
@@ -381,30 +381,30 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
};
void cAudio::SetHdmiDD(bool enable)
{
const char *opt[] = { "pcm", "spdif" };
lt_debug("%s %d\n", __func__, enable);
hal_debug("%s %d\n", __func__, enable);
proc_put("/proc/stb/hdmi/audio_source", opt[enable], strlen(opt[enable]));
}
void cAudio::SetSpdifDD(bool enable)
{
lt_debug("%s %d\n", __func__, enable);
hal_debug("%s %d\n", __func__, enable);
setBypassMode(!enable);
}
void cAudio::ScheduleMute(bool On)
{
lt_debug("%s %d\n", __FUNCTION__, On);
hal_debug("%s %d\n", __FUNCTION__, On);
}
void cAudio::EnableAnalogOut(bool enable)
{
lt_debug("%s %d\n", __FUNCTION__, enable);
hal_debug("%s %d\n", __FUNCTION__, enable);
}
#define AUDIO_BYPASS_ON 0
@@ -412,7 +412,7 @@ void cAudio::EnableAnalogOut(bool enable)
void cAudio::setBypassMode(bool disable)
{
const char *opt[] = { "passthrough", "downmix" };
lt_debug("%s %d\n", __func__, disable);
hal_debug("%s %d\n", __func__, disable);
proc_put("/proc/stb/audio/ac3", opt[disable], strlen(opt[disable]));
}

View File

@@ -70,21 +70,21 @@
#include <OpenThreads/Mutex>
#include <OpenThreads/ScopedLock>
#include "dmx_hal.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_debug_c(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, NULL, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args)
#define lt_info_z(args...) _lt_info(TRIPLE_DEBUG_DEMUX, thiz, args)
#define lt_debug_z(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, thiz, 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_debug_c(args...) _hal_debug(HAL_DEBUG_DEMUX, NULL, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_DEMUX, NULL, args)
#define hal_info_z(args...) _hal_info(HAL_DEBUG_DEMUX, thiz, args)
#define hal_debug_z(args...) _hal_debug(HAL_DEBUG_DEMUX, thiz, 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);
@@ -129,7 +129,7 @@ cDemux::cDemux(int n)
{
if (n < 0 || n >= NUM_DEMUX)
{
lt_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
hal_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
num = 0;
}
else
@@ -143,7 +143,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();
/* wait until Read() has released the mutex */
(*P->mutex).lock();
@@ -156,7 +156,7 @@ cDemux::~cDemux()
bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBufferSize)
{
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;
buffersize = uBufferSize;
@@ -170,13 +170,13 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
int flags = O_RDWR|O_CLOEXEC;
int devnum = dmx_source[num];
if (last_source == devnum) {
lt_debug_z("%s #%d: source (%d) did not change\n", __func__, num, last_source);
hal_debug_z("%s #%d: source (%d) did not change\n", __func__, num, last_source);
if (fd > -1)
return true;
}
if (fd > -1) {
/* we changed source -> close and reopen the fd */
lt_debug_z("%s #%d: FD ALREADY OPENED fd = %d lastsource %d devnum %d\n",
hal_debug_z("%s #%d: FD ALREADY OPENED fd = %d lastsource %d devnum %d\n",
__func__, num, fd, last_source, devnum);
close(fd);
}
@@ -187,10 +187,10 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
fd = open(devname[devnum], flags);
if (fd < 0)
{
lt_info_z("%s %s: %m\n", __FUNCTION__, devname[devnum]);
hal_info_z("%s %s: %m\n", __FUNCTION__, devname[devnum]);
return false;
}
lt_debug_z("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
hal_debug_z("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
num, DMX_T[dmx_type], dmx_type, buffersize, fd);
/* this would actually need locking, but the worst that weill happen is, that
@@ -199,9 +199,9 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
{
/* this should not change anything... */
int n = DMX_SOURCE_FRONT0 + devnum;
lt_info_z("%s: setting %s to source %d\n", __func__, devname[devnum], n);
hal_info_z("%s: setting %s to source %d\n", __func__, devname[devnum], n);
if (ioctl(fd, DMX_SET_SOURCE, &n) < 0)
lt_info_z("%s DMX_SET_SOURCE failed!\n", __func__);
hal_info_z("%s DMX_SET_SOURCE failed!\n", __func__);
else
init[devnum] = true;
}
@@ -211,7 +211,7 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
{
/* probably uBufferSize == 0 means "use default size". TODO: find a reasonable default */
if (ioctl(fd, DMX_SET_BUFFER_SIZE, buffersize) < 0)
lt_info_z("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
hal_info_z("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
}
last_source = devnum;
@@ -220,10 +220,10 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
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;
}
@@ -235,10 +235,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);
@@ -247,10 +247,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);
@@ -266,7 +266,7 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
#endif
if (fd < 0)
{
lt_info("%s #%d: not open!\n", __func__, num);
hal_info("%s #%d: not open!\n", __func__, num);
return -1;
}
/* avoid race in destructor: ~cDemux needs to wait until Read() returns */
@@ -291,7 +291,7 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
if (ufds.fd != fd)
{
/* Close() will set fd to -1, this is normal. Everything else is not. */
lt_info("%s:1 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
hal_info("%s:1 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
return -1;
}
if (!rc)
@@ -306,7 +306,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;
@@ -333,7 +333,7 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
}
if (ufds.fd != fd) /* does this ever happen? and if, is it harmful? */
{ /* read(-1,...) will just return EBADF anyway... */
lt_info("%s:2 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
hal_info("%s:2 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
return -1;
}
@@ -357,7 +357,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];
@@ -452,7 +452,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<FILTER_LENGTH;i++)fprintf(stderr,"%02hhx ",s_flt.filter[i]);fprintf(stderr,"\n");
@@ -480,7 +480,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]);
_open(this, num, fd, P->last_source, dmx_type, buffersize);
@@ -513,7 +513,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);
@@ -521,40 +521,40 @@ 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;
}
_open(this, num, fd, P->last_source, dmx_type, buffersize);
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) pid=%hx\n", __func__, Pid);
hal_info("%s: DMX_ADD_PID (%m) pid=%hx\n", __func__, Pid);
return (ret != -1);
}
@@ -562,27 +562,27 @@ 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)
{
/* apparently I can only get the PTS of the video decoder,
* but that's good enough for dvbsub */
lt_debug("%s #%d\n", __func__, num);
hal_debug("%s #%d\n", __func__, num);
int64_t pts = 0;
if (videoDecoder)
pts = videoDecoder->GetPTS();
@@ -591,7 +591,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 */
@@ -601,12 +601,12 @@ int cDemux::getUnit(void)
bool cDemux::SetSource(int unit, int source)
{
if (unit >= NUM_DEMUX || unit < 0) {
lt_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
hal_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return false;
}
lt_debug_c("%s(%d, %d) => %d to %d\n", __func__, unit, source, dmx_source[unit], source);
hal_debug_c("%s(%d, %d) => %d to %d\n", __func__, unit, source, dmx_source[unit], source);
if (source < 0 || source >= NUM_DEMUXDEV)
lt_info_c("%s(%d, %d) ERROR: source %d out of range!\n", __func__, unit, source, source);
hal_info_c("%s(%d, %d) ERROR: source %d out of range!\n", __func__, unit, source, source);
else
dmx_source[unit] = source;
return true;
@@ -615,9 +615,9 @@ bool cDemux::SetSource(int unit, int source)
int cDemux::GetSource(int unit)
{
if (unit >= NUM_DEMUX || unit < 0) {
lt_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
hal_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return -1;
}
lt_debug_c("%s(%d) => %d\n", __func__, unit, dmx_source[unit]);
hal_debug_c("%s(%d) => %d\n", __func__, unit, dmx_source[unit]);
return dmx_source[unit];
}

View File

@@ -16,9 +16,9 @@
#include "init.h"
#include "pwrmngr.h"
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
#include <stdio.h>
#include <dirent.h>
@@ -202,7 +202,7 @@ static void poll_input_devices(void) {
int r = poll(fds, nfds, 60000 /* ms */);
if (r < 0) {
if (errno != EAGAIN) {
lt_info("%s: poll(): %m\n", __func__);
hal_info("%s: poll(): %m\n", __func__);
inmux_thread_running = 0;
}
return;
@@ -243,12 +243,12 @@ void start_inmux_thread(void)
{
input_device[0].fd = open(input_device[0].name, O_RDWR | O_NONBLOCK); // nevis_ir. This is mandatory.
if (input_device[0].fd < 0){
lt_info("%s: open(%s): %m\n", __func__, input_device[0].name);
hal_info("%s: open(%s): %m\n", __func__, input_device[0].name);
return;
}
if (pthread_create(&inmux_task, 0, inmux_thread, NULL) != 0)
{
lt_info("%s: inmux thread pthread_create: %m\n", __func__);
hal_info("%s: inmux thread pthread_create: %m\n", __func__);
inmux_thread_running = 0;
return;
}
@@ -265,8 +265,8 @@ static bool initialized = false;
void init_td_api()
{
if (!initialized)
lt_debug_init();
lt_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
hal_debug_init();
hal_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
if (!initialized)
{
cCpuFreqManager f;
@@ -279,7 +279,7 @@ void init_td_api()
struct dmx_pes_filter_params p;
int dmx = open("/dev/dvb/adapter0/demux0", O_RDWR|O_CLOEXEC);
if (dmx < 0)
lt_info("%s: ERROR open /dev/dvb/adapter0/demux0 (%m)\n", __func__);
hal_info("%s: ERROR open /dev/dvb/adapter0/demux0 (%m)\n", __func__);
else
{
memset(&p, 0, sizeof(p));
@@ -295,12 +295,12 @@ void init_td_api()
else
reopen_input_devices();
initialized = true;
lt_info("%s end\n", __FUNCTION__);
hal_info("%s end\n", __FUNCTION__);
}
void shutdown_td_api()
{
lt_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
hal_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
if (initialized) {
stop_inmux_thread();
close_input_devices();

View File

@@ -46,9 +46,9 @@ extern "C" {
}
static uint8_t IRMP_PIN;
#include <lt_debug.h>
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
#include <hal_debug.h>
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
/* same defines as in neutrino's rcinput.h */
#define KEY_TTTV KEY_FN_1
@@ -197,7 +197,7 @@ static void *input_thread(void *)
int aotom_fd = -1;
IRMP_DATA d;
lt_info("LIRC/IRMP input converter thread starting...\n");
hal_info("LIRC/IRMP input converter thread starting...\n");
/* modprobe does not complain if the module is already loaded... */
system("/sbin/modprobe uinput");
@@ -208,7 +208,7 @@ static void *input_thread(void *)
if (uinput < 0)
{
lt_info("LIRC/IRMP input thread: unable to open /dev/uinput (%m)\n");
hal_info("LIRC/IRMP input thread: unable to open /dev/uinput (%m)\n");
thread_running = 2;
return NULL;
}
@@ -234,7 +234,7 @@ static void *input_thread(void *)
if (ioctl(uinput, UI_DEV_CREATE))
{
lt_info("LIRC/IRMP input thread UI_DEV_CREATE: %m\n");
hal_info("LIRC/IRMP input thread UI_DEV_CREATE: %m\n");
close(uinput);
return NULL;
}
@@ -270,7 +270,7 @@ static void *input_thread(void *)
}
evdev = atoi(p + 6);
sprintf(newdev, "event%d", evdev);
lt_info("LIRC/IRMP input thread: symlink /dev/input/nevis_ir to %s\n", newdev);
hal_info("LIRC/IRMP input thread: symlink /dev/input/nevis_ir to %s\n", newdev);
unlink("/dev/input/nevis_ir");
symlink(newdev, "/dev/input/nevis_ir");
break;
@@ -290,7 +290,7 @@ static void *input_thread(void *)
lircfd = open("/dev/lirc", O_RDONLY);
if (lircfd < 0)
{
lt_info("%s: open /dev/lirc: %m\n", __func__);
hal_info("%s: open /dev/lirc: %m\n", __func__);
goto out;
}
IRMP_PIN = 0xFF;
@@ -299,7 +299,7 @@ static void *input_thread(void *)
#define POLL_MS (100 * 1000)
#define LIRC_PULSE 0x01000000
#define LIRC_PULSE_MASK 0x00FFFFFF
lt_info("LIRC/IRMP input converter going into main loop...\n");
hal_info("LIRC/IRMP input converter going into main loop...\n");
aotom_fd = open("/dev/vfd", O_RDONLY);
@@ -323,7 +323,7 @@ static void *input_thread(void *)
if (ret == -1) {
/* errno != EINTR... */
lt_info("%s: lirmp: lircfd select: %m\n", __func__);
hal_info("%s: lirmp: lircfd select: %m\n", __func__);
break;
}
@@ -375,7 +375,7 @@ static void *input_thread(void *)
if (irmp_get_data (&d))
{
nodec = 0;
lt_debug("irmp_get_data proto: %2d addr: 0x%04x cmd: 0x%04x fl: %d\n",
hal_debug("irmp_get_data proto: %2d addr: 0x%04x cmd: 0x%04x fl: %d\n",
d.protocol, d.address, d.command, d.flags);
/* todo: do we need to complete the loop if we already
@@ -394,7 +394,7 @@ static void *input_thread(void *)
}
u.code = key_map[i].code;
u.value = (d.flags & 0x1) + 1;
//lt_debug("uinput write: value: %d code: %d\n", u.value, u.code);
//hal_debug("uinput write: value: %d code: %d\n", u.value, u.code);
last_code = u.code;
write(uinput, &u, sizeof(u));
if (aotom_fd > -1) {
@@ -425,7 +425,7 @@ void start_input_thread(void)
{
if (pthread_create(&thread, 0, input_thread, NULL) != 0)
{
lt_info("%s: LIRC/IRMP input thread pthread_create: %m\n", __func__);
hal_info("%s: LIRC/IRMP input thread pthread_create: %m\n", __func__);
thread_running = 0;
return;
}

View File

@@ -10,10 +10,10 @@
#include "player.h"
#include "playback_libeplayer3.h"
#include "lt_debug.h"
#include "hal_debug.h"
#define lt_debug(args...) _lt_debug(HAL_DEBUG_PLAYBACK, this, args)
#define lt_info(args...) _lt_info(HAL_DEBUG_PLAYBACK, this, args)
#define hal_debug(args...) _hal_debug(HAL_DEBUG_PLAYBACK, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_PLAYBACK, this, args)
extern cAudio *audioDecoder;
extern cVideo *videoDecoder;
@@ -40,7 +40,7 @@ bool cPlayback::Open(playmode_t PlayMode)
void cPlayback::Close(void)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
//Dagobert: movieplayer does not call stop, it calls close ;)
Stop();
@@ -63,7 +63,7 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
bool isHTTP = false;
no_probe = false;
lt_info("%s - filename=%s vpid=%u vtype=%d apid=%u ac3=%d\n", __func__, filename, vpid, vtype, apid, ac3);
hal_info("%s - filename=%s vpid=%u vtype=%d apid=%u ac3=%d\n", __func__, filename, vpid, vtype, apid, ac3);
init_jump = -1;
@@ -129,7 +129,7 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
bool cPlayback::Stop(void)
{
lt_info("%s playing %d\n", __func__, playing);
hal_info("%s playing %d\n", __func__, playing);
player->Stop();
player->output.Close();
@@ -141,7 +141,7 @@ bool cPlayback::Stop(void)
bool cPlayback::SetAPid(int pid, bool /* ac3 */)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
return player->SwitchAudio(pid);
}
@@ -162,7 +162,7 @@ bool cPlayback::SetTeletextPid(int pid)
bool cPlayback::SetSpeed(int speed)
{
lt_info("%s playing %d speed %d\n", __func__, playing, speed);
hal_info("%s playing %d speed %d\n", __func__, playing, speed);
if (!decoders_closed)
{
@@ -211,7 +211,7 @@ bool cPlayback::SetSpeed(int speed)
bool cPlayback::GetSpeed(int &speed) const
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
speed = nPlaybackSpeed;
return true;
}
@@ -225,7 +225,7 @@ void cPlayback::GetPts(uint64_t &pts)
bool cPlayback::GetPosition(int &position, int &duration)
{
bool got_duration = false;
lt_debug("%s %d %d\n", __func__, position, duration);
hal_debug("%s %d %d\n", __func__, position, duration);
/* hack: if the file is growing (timeshift), then determine its length
* by comparing the mtime with the mtime of the xml file */
@@ -253,7 +253,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
return false;
if (!player->isPlaying) {
lt_info("%s !!!!EOF!!!! < -1\n", __func__);
hal_info("%s !!!!EOF!!!! < -1\n", __func__);
position = duration + 1000;
// duration = 0;
// this is stupid
@@ -287,7 +287,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
bool cPlayback::SetPosition(int position, bool absolute)
{
lt_info("%s %d\n", __func__, position);
hal_info("%s %d\n", __func__, position);
if (!playing)
{
/* the calling sequence is:
@@ -305,7 +305,7 @@ bool cPlayback::SetPosition(int position, bool absolute)
void cPlayback::FindAllPids(int *pids, unsigned int *ac3flags, unsigned int *numpids, std::string *language)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
unsigned int i = 0;
std::vector<Track> tracks = player->manager.getAudioTracks();
@@ -320,7 +320,7 @@ void cPlayback::FindAllPids(int *pids, unsigned int *ac3flags, unsigned int *num
void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
unsigned int i = 0;
std::vector<Track> tracks = player->manager.getSubtitleTracks();
@@ -335,7 +335,7 @@ void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::strin
void cPlayback::FindAllTeletextsubtitlePids(int *pids, unsigned int *numpids, std::string *language, int *mags, int *pages)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
unsigned int i = 0;
std::vector<Track> tracks = player->manager.getTeletextTracks();
@@ -396,7 +396,7 @@ void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::str
cPlayback::cPlayback(int num __attribute__((unused)))
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
playing = false;
decoders_closed = false;
ProgramSelectionCallback = NULL;
@@ -407,7 +407,7 @@ cPlayback::cPlayback(int num __attribute__((unused)))
cPlayback::~cPlayback()
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
delete player;
}
@@ -427,7 +427,7 @@ uint64_t cPlayback::GetReadCount() {
int cPlayback::GetAPid(void)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
return player->GetAudioPid();
}

View File

@@ -12,9 +12,9 @@
#include <aio.h>
#include "record_lib.h"
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_RECORD, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_RECORD, this, args)
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_RECORD, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_RECORD, this, args)
/* helper function to call the cpp thread loop */
void *execute_record_thread(void *c)
@@ -33,7 +33,7 @@ void *execute_writer_thread(void *c)
cRecord::cRecord(int num, int bs_dmx, int bs)
{
lt_info("%s %d\n", __func__, num);
hal_info("%s %d\n", __func__, num);
dmx = NULL;
record_thread_running = false;
file_fd = -1;
@@ -47,14 +47,14 @@ cRecord::cRecord(int num, int bs_dmx, int bs)
cRecord::~cRecord()
{
lt_info("%s: calling ::Stop()\n", __func__);
hal_info("%s: calling ::Stop()\n", __func__);
Stop();
lt_info("%s: end\n", __func__);
hal_info("%s: end\n", __func__);
}
bool cRecord::Open(void)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
exit_flag = RECORD_STOPPED;
return true;
}
@@ -63,13 +63,13 @@ bool cRecord::Open(void)
// unused
void cRecord::Close(void)
{
lt_info("%s: \n", __func__);
hal_info("%s: \n", __func__);
}
#endif
bool cRecord::Start(int fd, unsigned short vpid, unsigned short *apids, int numpids, uint64_t)
{
lt_info("%s: fd %d, vpid 0x%03x\n", __func__, fd, vpid);
hal_info("%s: fd %d, vpid 0x%03x\n", __func__, fd, vpid);
int i;
if (!dmx)
@@ -91,7 +91,7 @@ bool cRecord::Start(int fd, unsigned short vpid, unsigned short *apids, int nump
{
exit_flag = RECORD_FAILED_READ;
errno = i;
lt_info("%s: error creating thread! (%m)\n", __func__);
hal_info("%s: error creating thread! (%m)\n", __func__);
delete dmx;
dmx = NULL;
return false;
@@ -102,10 +102,10 @@ bool cRecord::Start(int fd, unsigned short vpid, unsigned short *apids, int nump
bool cRecord::Stop(void)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
if (exit_flag != RECORD_RUNNING)
lt_info("%s: status not RUNNING? (%d)\n", __func__, exit_flag);
hal_info("%s: status not RUNNING? (%d)\n", __func__, exit_flag);
exit_flag = RECORD_STOPPED;
if (record_thread_running)
@@ -114,7 +114,7 @@ bool cRecord::Stop(void)
/* We should probably do that from the destructor... */
if (!dmx)
lt_info("%s: dmx == NULL?\n", __func__);
hal_info("%s: dmx == NULL?\n", __func__);
else
delete dmx;
dmx = NULL;
@@ -122,7 +122,7 @@ bool cRecord::Stop(void)
if (file_fd != -1)
close(file_fd);
else
lt_info("%s: file_fd not open??\n", __func__);
hal_info("%s: file_fd not open??\n", __func__);
file_fd = -1;
return true;
}
@@ -133,9 +133,9 @@ bool cRecord::ChangePids(unsigned short /*vpid*/, unsigned short *apids, int num
int j;
bool found;
unsigned short pid;
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
if (!dmx) {
lt_info("%s: DMX = NULL\n", __func__);
hal_info("%s: DMX = NULL\n", __func__);
return false;
}
pids = dmx->pesfds;
@@ -169,9 +169,9 @@ bool cRecord::ChangePids(unsigned short /*vpid*/, unsigned short *apids, int num
bool cRecord::AddPid(unsigned short pid)
{
std::vector<pes_pids> pids;
lt_info("%s: \n", __func__);
hal_info("%s: \n", __func__);
if (!dmx) {
lt_info("%s: DMX = NULL\n", __func__);
hal_info("%s: DMX = NULL\n", __func__);
return false;
}
pids = dmx->pesfds;
@@ -210,7 +210,7 @@ void cRecord::WriterThread()
void cRecord::RecordThread()
{
lt_info("%s: begin\n", __func__);
hal_info("%s: begin\n", __func__);
char threadname[17];
strncpy(threadname, "RecordThread", sizeof(threadname));
threadname[16] = 0;
@@ -223,20 +223,20 @@ void cRecord::RecordThread()
struct aiocb a;
buf = (uint8_t *)malloc(bufsize);
lt_info("BUFSIZE=0x%x READSIZE=0x%x\n", bufsize, readsize);
hal_info("BUFSIZE=0x%x READSIZE=0x%x\n", bufsize, readsize);
if (!buf)
{
exit_flag = RECORD_FAILED_MEMORY;
lt_info("%s: unable to allocate buffer! (out of memory)\n", __func__);
hal_info("%s: unable to allocate buffer! (out of memory)\n", __func__);
if (failureCallback)
failureCallback(failureData);
lt_info("%s: end\n", __func__);
hal_info("%s: end\n", __func__);
pthread_exit(NULL);
}
int val = fcntl(file_fd, F_GETFL);
if (fcntl(file_fd, F_SETFL, val|O_APPEND))
lt_info("%s: O_APPEND? (%m)\n", __func__);
hal_info("%s: O_APPEND? (%m)\n", __func__);
memset(&a, 0, sizeof(a));
a.aio_fildes = file_fd;
@@ -251,20 +251,20 @@ void cRecord::RecordThread()
if (buf_pos < bufsize)
{
if (overflow_count) {
lt_info("%s: Overflow cleared after %d iterations\n", __func__, overflow_count);
hal_info("%s: Overflow cleared after %d iterations\n", __func__, overflow_count);
overflow_count = 0;
}
int toread = bufsize - buf_pos;
if (toread > readsize)
toread = readsize;
ssize_t s = dmx->Read(buf + buf_pos, toread, 50);
lt_debug("%s: buf_pos %6d s %6d / %6d\n", __func__,
hal_debug("%s: buf_pos %6d s %6d / %6d\n", __func__,
buf_pos, (int)s, bufsize - buf_pos);
if (s < 0)
{
if (errno != EAGAIN && (errno != EOVERFLOW || !overflow))
{
lt_info("%s: read failed: %m\n", __func__);
hal_info("%s: read failed: %m\n", __func__);
exit_flag = RECORD_FAILED_READ;
state = REC_STATUS_OVERFLOW;
break;
@@ -291,13 +291,13 @@ void cRecord::RecordThread()
overflow_count = 0;
overflow = true;
if (!(overflow_count % 10))
lt_info("%s: buffer full! Overflow? (%d)\n", __func__, ++overflow_count);
hal_info("%s: buffer full! Overflow? (%d)\n", __func__, ++overflow_count);
state = REC_STATUS_SLOW;
}
r = aio_error(&a);
if (r == EINPROGRESS)
{
lt_debug("%s: aio in progress, free: %d\n", __func__, bufsize - buf_pos);
hal_debug("%s: aio in progress, free: %d\n", __func__, bufsize - buf_pos);
continue;
}
// not calling aio_return causes a memory leak --martii
@@ -305,11 +305,11 @@ void cRecord::RecordThread()
if (r < 0)
{
exit_flag = RECORD_FAILED_FILE;
lt_debug("%s: aio_return = %d (%m)\n", __func__, r);
hal_debug("%s: aio_return = %d (%m)\n", __func__, r);
break;
}
else
lt_debug("%s: aio_return = %d, free: %d\n", __func__, r, bufsize - buf_pos);
hal_debug("%s: aio_return = %d, free: %d\n", __func__, r, bufsize - buf_pos);
if (posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED))
perror("posix_fadvise");
if (queued)
@@ -323,7 +323,7 @@ void cRecord::RecordThread()
r = aio_write(&a);
if (r)
{
lt_info("%s: aio_write %d (%m)\n", __func__, r);
hal_info("%s: aio_write %d (%m)\n", __func__, r);
exit_flag = RECORD_FAILED_FILE;
break;
}
@@ -331,7 +331,7 @@ void cRecord::RecordThread()
dmx->Stop();
while (true) /* write out the unwritten buffer content */
{
lt_debug("%s: run-out write, buf_pos %d\n", __func__, buf_pos);
hal_debug("%s: run-out write, buf_pos %d\n", __func__, buf_pos);
r = aio_error(&a);
if (r == EINPROGRESS)
{
@@ -342,7 +342,7 @@ void cRecord::RecordThread()
if (r < 0)
{
exit_flag = RECORD_FAILED_FILE;
lt_info("%s: aio_result: %d (%m)\n", __func__, r);
hal_info("%s: aio_result: %d (%m)\n", __func__, r);
break;
}
if (!queued)
@@ -372,7 +372,7 @@ void cRecord::RecordThread()
if ((exit_flag != RECORD_STOPPED) && failureCallback)
failureCallback(failureData);
lt_info("%s: end\n", __func__);
hal_info("%s: end\n", __func__);
pthread_exit(NULL);
}

View File

@@ -37,7 +37,7 @@
#include <linux/stmfb.h>
#include <bpamem.h>
#include "video_lib.h"
#include "lt_debug.h"
#include "hal_debug.h"
#include <proc_tools.h>
@@ -48,18 +48,18 @@ extern "C"
#include <libswscale/swscale.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_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_VIDEO, NULL, args)
#define hal_debug(args...) _hal_debug(HAL_DEBUG_VIDEO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_VIDEO, this, args)
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_VIDEO, NULL, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_VIDEO, NULL, args)
#define fop(cmd, args...) ({ \
int _r; \
if (fd >= 0) { \
if ((_r = ::cmd(fd, args)) < 0) \
lt_info(#cmd"(fd, "#args")\n"); \
hal_info(#cmd"(fd, "#args")\n"); \
else \
lt_debug(#cmd"(fd, "#args")\n");\
hal_debug(#cmd"(fd, "#args")\n");\
} \
else { _r = fd; } \
_r; \
@@ -133,17 +133,17 @@ static int hdmi_out(bool enable)
{
struct stmfbio_output_configuration out;
int ret = -1;
lt_info_c("%s(%d)\n", __func__, enable);
hal_info_c("%s(%d)\n", __func__, enable);
int fb = open("/dev/fb0", O_RDWR);
if (fb < 0)
{
lt_debug_c("%s: can't open /dev/fb0 (%m)\n", __func__);
hal_debug_c("%s: can't open /dev/fb0 (%m)\n", __func__);
return -1;
}
out.outputid = STMFBIO_OUTPUTID_MAIN;
if (ioctl(fb, STMFBIO_GET_OUTPUT_CONFIG, &out) < 0)
{
lt_debug_c("%s: STMFBIO_GET_OUTPUT_CONFIG (%m)\n", __func__);
hal_debug_c("%s: STMFBIO_GET_OUTPUT_CONFIG (%m)\n", __func__);
goto out;
}
hdmi_enabled = enable;
@@ -157,7 +157,7 @@ static int hdmi_out(bool enable)
ret = ioctl(fb, STMFBIO_SET_OUTPUT_CONFIG, &out);
if (ret < 0)
_lt_debug(TRIPLE_DEBUG_VIDEO, NULL, "%s: STMFBIO_SET_OUTPUT_CONFIG (%m)\n", __func__);
_hal_debug(HAL_DEBUG_VIDEO, NULL, "%s: STMFBIO_SET_OUTPUT_CONFIG (%m)\n", __func__);
out:
close(fb);
return ret;
@@ -300,7 +300,7 @@ int image_to_mpeg2(const char *image_name, const char *encode_name)
cVideo::cVideo(int, void *, void *, unsigned int unit)
{
lt_debug("%s unit %u\n", __func__, unit);
hal_debug("%s unit %u\n", __func__, unit);
brightness = -1;
contrast = -1;
@@ -310,7 +310,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit)
scartvoltage = -1;
video_standby = 0;
if (unit > 1) {
lt_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
devnum = 0;
} else
devnum = unit;
@@ -326,7 +326,7 @@ cVideo::~cVideo(void)
void cVideo::openDevice(void)
{
int n = 0;
lt_debug("#%d: %s\n", devnum, __func__);
hal_debug("#%d: %s\n", devnum, __func__);
/* todo: this fd checking is racy, should be protected by a lock */
if (fd != -1) /* already open */
return;
@@ -340,14 +340,14 @@ retry:
if (++n < 10)
goto retry;
}
lt_info("#%d: %s cannot open %s: %m, retries %d\n", devnum, __func__, VDEV[devnum], n);
hal_info("#%d: %s cannot open %s: %m, retries %d\n", devnum, __func__, VDEV[devnum], n);
}
playstate = VIDEO_STOPPED;
}
void cVideo::closeDevice(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
/* looks like sometimes close is unhappy about non-empty buffers */
Start();
if (fd >= 0)
@@ -363,22 +363,22 @@ int cVideo::setAspectRatio(int aspect, int mode)
int n;
int mo = (mode < 0||mode > 3) ? 4 : mode;
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[mo]);
hal_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[mo]);
if (aspect > 3 || aspect == 0)
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
hal_info("%s: invalid aspect: %d\n", __func__, aspect);
else if (aspect > 0) /* -1 == don't set */
{
lt_debug("%s: /proc/stb/video/aspect -> %s\n", __func__, a[aspect]);
hal_debug("%s: /proc/stb/video/aspect -> %s\n", __func__, a[aspect]);
n = proc_put("/proc/stb/video/aspect", a[aspect], strlen(a[aspect]));
if (n < 0)
lt_info("%s: proc_put /proc/stb/video/aspect (%m)\n", __func__);
hal_info("%s: proc_put /proc/stb/video/aspect (%m)\n", __func__);
}
if (mode == -1)
return 0;
lt_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mo]);
hal_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mo]);
n = proc_put("/proc/stb/video/policy", m[mo], strlen(m[mo]));
if (n < 0)
return 1;
@@ -396,10 +396,10 @@ int cVideo::getAspectRatio(void)
}
if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0)
{
lt_info("%s: VIDEO_GET_SIZE %m\n", __func__);
hal_info("%s: VIDEO_GET_SIZE %m\n", __func__);
return -1;
}
lt_debug("#%d: %s: %d\n", devnum, __func__, s.aspect_ratio);
hal_debug("#%d: %s: %d\n", devnum, __func__, s.aspect_ratio);
return s.aspect_ratio * 2 + 1;
}
@@ -414,14 +414,14 @@ int cVideo::setCroppingMode(int /*vidDispMode_t format*/)
f = format_string[format];
else
f = "ILLEGAL format!";
lt_debug("%s(%d) => %s\n", __FUNCTION__, format, f);
hal_debug("%s(%d) => %s\n", __FUNCTION__, format, f);
return fop(ioctl, MPEG_VID_SET_DISPMODE, format);
#endif
}
int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned short /*VideoPid*/, void * /*hChannel*/)
{
lt_debug("#%d: %s playstate=%d\n", devnum, __func__, playstate);
hal_debug("#%d: %s playstate=%d\n", devnum, __func__, playstate);
#if 0
if (playstate == VIDEO_PLAYING)
return 0;
@@ -430,7 +430,7 @@ int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned sho
#endif
/* implicitly do StopPicture() on video->Start() */
if (stillpicture) {
lt_info("%s: stillpicture == true, doing implicit StopPicture()\n", __func__);
hal_info("%s: stillpicture == true, doing implicit StopPicture()\n", __func__);
stillpicture = false;
Stop(1);
}
@@ -458,10 +458,10 @@ int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned sho
int cVideo::Stop(bool blank)
{
lt_debug("#%d: %s(%d)\n", devnum, __func__, blank);
hal_debug("#%d: %s(%d)\n", devnum, __func__, blank);
if (stillpicture)
{
lt_debug("%s: stillpicture == true\n", __func__);
hal_debug("%s: stillpicture == true\n", __func__);
return -1;
}
playstate = blank ? VIDEO_STOPPED : VIDEO_FREEZED;
@@ -479,25 +479,25 @@ int cVideo::setBlank(int)
int cVideo::SetVideoSystem(int video_system, bool remember)
{
lt_debug("%s(%d, %d)\n", __func__, video_system, remember);
hal_debug("%s(%d, %d)\n", __func__, video_system, remember);
char current[32];
if (video_system > VIDEO_STD_MAX)
{
lt_info("%s: video_system (%d) > VIDEO_STD_MAX (%d)\n", __func__, video_system, VIDEO_STD_MAX);
hal_info("%s: video_system (%d) > VIDEO_STD_MAX (%d)\n", __func__, video_system, VIDEO_STD_MAX);
return -1;
}
int ret = proc_get("/proc/stb/video/videomode", current, 32);
if (strcmp(current, vid_modes[video_system]) == 0)
{
lt_info("%s: video_system %d (%s) already set, skipping\n", __func__, video_system, current);
hal_info("%s: video_system %d (%s) already set, skipping\n", __func__, video_system, current);
return 0;
}
lt_info("%s: old: '%s' new: '%s'\n", __func__, current, vid_modes[video_system]);
hal_info("%s: old: '%s' new: '%s'\n", __func__, current, vid_modes[video_system]);
bool stopped = false;
if (playstate == VIDEO_PLAYING)
{
lt_info("%s: playstate == VIDEO_PLAYING, stopping video\n", __func__);
hal_info("%s: playstate == VIDEO_PLAYING, stopping video\n", __func__);
Stop();
stopped = true;
}
@@ -519,7 +519,7 @@ int cVideo::GetVideoSystem(void)
if (strcmp(current, vid_modes[i]) == 0)
return i;
}
lt_info("%s: could not find '%s' mode, returning VIDEO_STD_720P50\n", __func__, current);
hal_info("%s: could not find '%s' mode, returning VIDEO_STD_720P50\n", __func__, current);
return VIDEO_STD_720P50;
}
@@ -528,7 +528,7 @@ void cVideo::GetVideoSystemFormatName(cs_vs_format_t *format, int system)
if (system == -1)
system = GetVideoSystem();
if (system < 0 || system > VIDEO_STD_1080P50) {
lt_info("%s: invalid system %d\n", __func__, system);
hal_info("%s: invalid system %d\n", __func__, system);
strcpy(format->format, "invalid");
} else
strcpy(format->format, vid_modes[system]);
@@ -541,10 +541,10 @@ int cVideo::getPlayState(void)
void cVideo::SetVideoMode(analog_mode_t mode)
{
lt_debug("#%d: %s(%d)\n", devnum, __func__, mode);
hal_debug("#%d: %s(%d)\n", devnum, __func__, mode);
if (!(mode & ANALOG_SCART_MASK))
{
lt_debug("%s: non-SCART mode ignored\n", __func__);
hal_debug("%s: non-SCART mode ignored\n", __func__);
return;
}
const char *m;
@@ -557,7 +557,7 @@ void cVideo::SetVideoMode(analog_mode_t mode)
m = "rgb";
break;
default:
lt_info("%s unknown mode %d\n", __func__, mode);
hal_info("%s unknown mode %d\n", __func__, mode);
m = "rgb";
break; /* default to rgb */
}
@@ -566,7 +566,7 @@ void cVideo::SetVideoMode(analog_mode_t mode)
void cVideo::ShowPicture(const char * fname, const char *_destname)
{
lt_debug("%s(%s)\n", __func__, fname);
hal_debug("%s(%s)\n", __func__, fname);
//static const unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 };
static const unsigned char pes_header[] = {0x0, 0x0, 0x1, 0xe0, 0x00, 0x00, 0x80, 0x80, 0x5, 0x21, 0x0, 0x1, 0x0, 0x1};
static const unsigned char seq_end[] = { 0x00, 0x00, 0x01, 0xB7 };
@@ -577,7 +577,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
if (video_standby)
{
/* does not work and the driver does not seem to like it */
lt_info("%s: video_standby == true\n", __func__);
hal_info("%s: video_standby == true\n", __func__);
return;
}
const char *lastDot = strrchr(fname, '.');
@@ -590,7 +590,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
strcpy(destname, "/tmp/cache");
if (stat(fname, &st2))
{
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
hal_info("%s: could not stat %s (%m)\n", __func__, fname);
return;
}
mkdir(destname, 0755);
@@ -618,7 +618,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
mfd = open(destname, O_RDONLY);
if (mfd < 0)
{
lt_info("%s cannot open %s: %m\n", __func__, destname);
hal_info("%s cannot open %s: %m\n", __func__, destname);
goto out;
}
fstat(mfd, &st);
@@ -631,13 +631,13 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
stillpicture = true;
if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0)
lt_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
hal_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
bool seq_end_avail = false;
off_t pos=0;
unsigned char *iframe = (unsigned char *)malloc((st.st_size < 8192) ? 8192 : st.st_size);
if (! iframe)
{
lt_info("%s: malloc failed (%m)\n", __func__);
hal_info("%s: malloc failed (%m)\n", __func__);
goto out;
}
read(mfd, iframe, st.st_size);
@@ -665,14 +665,14 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
void cVideo::StopPicture()
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
stillpicture = false;
Stop(1);
}
void cVideo::Standby(unsigned int bOn)
{
lt_debug("%s(%d)\n", __func__, bOn);
hal_debug("%s(%d)\n", __func__, bOn);
if (bOn)
{
closeDevice();
@@ -721,7 +721,7 @@ int cVideo::getBlank(void)
free(line);
fclose(f);
int ret = (count == lastcount); /* no new decode -> return 1 */
lt_debug("#%d: %s: %d (irq++: %d)\n", devnum, __func__, ret, count - lastcount);
hal_debug("#%d: %s: %d (irq++: %d)\n", devnum, __func__, ret, count - lastcount);
lastcount = count;
return ret;
}
@@ -738,7 +738,7 @@ void cVideo::VideoParamWatchdog(void)
ioctl(fd, MPEG_VID_GET_V_INFO_RAW, &v_info);
if (_v_info != v_info)
{
lt_debug("%s params changed. old: %08x new: %08x\n", __FUNCTION__, _v_info, v_info);
hal_debug("%s params changed. old: %08x new: %08x\n", __FUNCTION__, _v_info, v_info);
setAspectRatio(-1, -1);
}
_v_info = v_info;
@@ -753,7 +753,7 @@ void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h, int startx, i
* TODO: check this in the driver sources */
int xres = 720; /* proc_get_hex("/proc/stb/vmpeg/0/xres") */
int yres = 576; /* proc_get_hex("/proc/stb/vmpeg/0/yres") */
lt_debug("#%d %s: x:%d y:%d w:%d h:%d ow:%d oh:%d\n", devnum, __func__, x, y, w, h, osd_w, osd_h);
hal_debug("#%d %s: x:%d y:%d w:%d h:%d ow:%d oh:%d\n", devnum, __func__, x, y, w, h, osd_w, osd_h);
if (x == -1 && y == -1 && w == -1 && h == -1)
{
_w = xres;
@@ -779,7 +779,7 @@ void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h, int startx, i
_w /= 1280;
_h /= 720;
}
lt_debug("#%d %s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", devnum, __func__, _x, _y, _w, _h, xres, yres);
hal_debug("#%d %s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", devnum, __func__, _x, _y, _w, _h, xres, yres);
sprintf(buffer, "%x %x %x %x", _x, _y, _w, _h);
proc_put(VMPEG_dst_all[devnum], buffer, strlen(buffer));
}
@@ -831,12 +831,12 @@ void cVideo::getPictureInfo(int &width, int &height, int &rate)
rate = rate2csapi(r);
height = s.h;
width = s.w;
lt_debug("#%d: %s: rate: %d, width: %d height: %d\n", devnum, __func__, rate, width, height);
hal_debug("#%d: %s: rate: %d, width: %d height: %d\n", devnum, __func__, rate, width, height);
}
void cVideo::SetSyncMode(AVSYNC_TYPE mode)
{
lt_debug("%s %d\n", __func__, mode);
hal_debug("%s %d\n", __func__, mode);
/*
* { 0, LOCALE_OPTIONS_OFF },
* { 1, LOCALE_OPTIONS_ON },
@@ -861,7 +861,7 @@ int cVideo::SetStreamType(VIDEO_FORMAT type)
"VIDEO_FORMAT_PNG"
};
int t;
lt_debug("#%d: %s type=%s\n", devnum, __func__, VF[type]);
hal_debug("#%d: %s type=%s\n", devnum, __func__, VF[type]);
switch (type)
{
@@ -884,7 +884,7 @@ int cVideo::SetStreamType(VIDEO_FORMAT type)
}
if (ioctl(fd, VIDEO_SET_STREAMTYPE, t) < 0)
lt_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t);
hal_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t);
return 0;
}
@@ -892,13 +892,13 @@ int64_t cVideo::GetPTS(void)
{
int64_t pts = 0;
if (ioctl(fd, VIDEO_GET_PTS, &pts) < 0)
lt_info("%s: GET_PTS failed (%m)\n", __func__);
hal_info("%s: GET_PTS failed (%m)\n", __func__);
return pts;
}
void cVideo::SetDemux(cDemux *)
{
lt_debug("#%d %s not implemented yet\n", devnum, __func__);
hal_debug("#%d %s not implemented yet\n", devnum, __func__);
}
void cVideo::SetControl(int control, int value) {
@@ -1177,7 +1177,7 @@ static const uint32_t yuv2rgbtable_bv[256] = {
/* TODO: aspect ratio correction and PIP */
bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool get_video, bool get_osd, bool scale_to_video)
{
lt_info("%s: get_video: %d get_osd: %d scale_to_video: %d\n",
hal_info("%s: get_video: %d get_osd: %d scale_to_video: %d\n",
__func__, get_video, get_osd, scale_to_video);
int fbfd = -1, bpafd = -1;
@@ -1189,26 +1189,26 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
/* this hints at incorrect usage */
if (video != NULL)
lt_info("%s: WARNING, video != NULL?\n", __func__);
hal_info("%s: WARNING, video != NULL?\n", __func__);
fbfd = open("/dev/fb0", O_RDWR);
if (fbfd < 0) {
lt_info("%s: cannot open open /dev/fb0 (%m)\n", __func__);
hal_info("%s: cannot open open /dev/fb0 (%m)\n", __func__);
return false;
}
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1)
lt_info("%s: FBIOGET_FSCREENINFO (%m)\n", __func__);
hal_info("%s: FBIOGET_FSCREENINFO (%m)\n", __func__);
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &var_screeninfo) == -1)
lt_info("%s: FBIOGET_VSCREENINFO (%m)\n", __func__);
hal_info("%s: FBIOGET_VSCREENINFO (%m)\n", __func__);
if (var_screeninfo.bits_per_pixel != 32) {
lt_info("%s: only 32bit framebuffer supported.\n", __func__);
hal_info("%s: only 32bit framebuffer supported.\n", __func__);
close(fbfd);
return false;
}
if (fix_screeninfo.line_length - (var_screeninfo.xres * 4) != 0) {
lt_info("%s: framebuffer with offset not supported.\n", __func__);
hal_info("%s: framebuffer with offset not supported.\n", __func__);
close(fbfd);
return false;
}
@@ -1255,7 +1255,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
bpafd = open("/dev/bpamem0", O_RDWR | O_CLOEXEC);
if (bpafd < 0)
{
lt_info("%s: cannot open /dev/bpamem0: %m\n", __func__);
hal_info("%s: cannot open /dev/bpamem0: %m\n", __func__);
goto error_cleanup;
}
BPAMemAllocMemData bpa_data;
@@ -1263,7 +1263,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
bpa_data.mem_size = outmem + osdmem + vidmem + 4096;
if (ioctl(bpafd, BPAMEMIO_ALLOCMEM, &bpa_data))
{
lt_info("%s: cannot allocate %lu bytes of BPA2 memory\n", __func__, bpa_data.mem_size);
hal_info("%s: cannot allocate %lu bytes of BPA2 memory\n", __func__, bpa_data.mem_size);
goto error_cleanup;
}
close(bpafd);
@@ -1273,13 +1273,13 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
bpafd = open(bpa_mem_device, O_RDWR | O_CLOEXEC);
if (bpafd < 0)
{
lt_info("%s: cannot open secondary bpamem device %s: %m\n", __func__, bpa_mem_device);
hal_info("%s: cannot open secondary bpamem device %s: %m\n", __func__, bpa_mem_device);
goto error_cleanup;
}
bpa = (uint8_t *)mmap(0, bpa_data.mem_size, PROT_WRITE|PROT_READ, MAP_SHARED, bpafd, 0);
if (bpa == MAP_FAILED)
{
lt_info("%s: cannot map from bpamem: %m\n", __func__);
hal_info("%s: cannot map from bpamem: %m\n", __func__);
ioctl(bpafd, BPAMEMIO_FREEMEM);
goto error_cleanup;
}
@@ -1318,19 +1318,19 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
fclose(pipe);
}
if (vid_phys_addr == 0) {
lt_info("%s: primary display pane not found in /proc/bpa2\n", __func__);
hal_info("%s: primary display pane not found in /proc/bpa2\n", __func__);
}
mfd = open("/dev/mem", O_RDWR | O_CLOEXEC);
if (mfd < 0) {
lt_info("%s: cannot open open /dev/mem (%m)\n", __func__);
hal_info("%s: cannot open open /dev/mem (%m)\n", __func__);
goto error_cleanup;
}
lt_info("%s: Using bpa2 part LMI_VID - 0x%lx %lu\n", __func__, vid_phys_addr, vid_mem_size);
hal_info("%s: Using bpa2 part LMI_VID - 0x%lx %lu\n", __func__, vid_phys_addr, vid_mem_size);
decode_surface = (uint8_t *)mmap(0, vid_mem_size, PROT_READ, MAP_SHARED, mfd, vid_phys_addr);
if (decode_surface == MAP_FAILED) {
lt_info("%s: cannot mmap /dev/mem for VIDEO (%m)\n", __func__);
hal_info("%s: cannot mmap /dev/mem for VIDEO (%m)\n", __func__);
close(mfd);
goto error_cleanup;
}
@@ -1503,7 +1503,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
{
uint8_t *lfb = (uint8_t *)mmap(0, fix_screeninfo.smem_len, PROT_READ, MAP_SHARED, fbfd, 0);
if (lfb == MAP_FAILED)
lt_info("%s: mmap fb memory failed (%m)\n", __func__);
hal_info("%s: mmap fb memory failed (%m)\n", __func__);
else {
memcpy(osd, lfb, fix_screeninfo.line_length*var_screeninfo.yres);
munmap(lfb, fix_screeninfo.smem_len);
@@ -1566,7 +1566,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
blt_data.srcMemSize = vidmem;
blt_data.dstMemSize = outmem;
if (ioctl(fbfd, STMFBIO_BLT_EXTERN, &blt_data) < 0)
lt_info("%s: STMFBIO_BLT_EXTERN video: %m\n", __func__);
hal_info("%s: STMFBIO_BLT_EXTERN video: %m\n", __func__);
}
if (get_osd)
{
@@ -1595,7 +1595,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
blt_data.srcMemSize = osdmem;
blt_data.dstMemSize = outmem;
if (ioctl(fbfd, STMFBIO_BLT_EXTERN, &blt_data) < 0)
lt_info("%s: STMFBIO_BLT_EXTERN osd: %m\n", __func__);
hal_info("%s: STMFBIO_BLT_EXTERN osd: %m\n", __func__);
}
ioctl(fbfd, STMFBIO_SYNC_BLITTER);
@@ -1603,7 +1603,7 @@ bool cVideo::GetScreenImage(unsigned char * &video, int &xres, int &yres, bool g
if (video)
memcpy(video, bpa, outmem);
else
lt_info("%s: could not allocate screenshot buffer (%d bytes)\n", __func__, xres * yres * 4);
hal_info("%s: could not allocate screenshot buffer (%d bytes)\n", __func__, xres * yres * 4);
munmap(bpa, bpa_data.mem_size);
ioctl(bpafd, BPAMEMIO_FREEMEM);
close(bpafd);