mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-28 07:51:21 +02:00
generic-pc: allow to disable softdecoder for debugging
This commit is contained in:
@@ -45,11 +45,14 @@ extern cDemux *audioDemux;
|
|||||||
static uint8_t *dmxbuf = NULL;
|
static uint8_t *dmxbuf = NULL;
|
||||||
static int bufpos;
|
static int bufpos;
|
||||||
|
|
||||||
|
extern bool HAL_nodec;
|
||||||
|
|
||||||
static cAudio *gThiz = NULL;
|
static cAudio *gThiz = NULL;
|
||||||
|
|
||||||
cAudio::cAudio(void *, void *, void *)
|
cAudio::cAudio(void *, void *, void *)
|
||||||
{
|
{
|
||||||
thread_started = false;
|
thread_started = false;
|
||||||
|
if (!HAL_nodec)
|
||||||
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
|
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
|
||||||
bufpos = 0;
|
bufpos = 0;
|
||||||
curr_pts = 0;
|
curr_pts = 0;
|
||||||
@@ -89,6 +92,7 @@ int cAudio::setVolume(unsigned int left, unsigned int right)
|
|||||||
int cAudio::Start(void)
|
int cAudio::Start(void)
|
||||||
{
|
{
|
||||||
lt_info("%s >\n", __func__);
|
lt_info("%s >\n", __func__);
|
||||||
|
if (! HAL_nodec)
|
||||||
OpenThreads::Thread::start();
|
OpenThreads::Thread::start();
|
||||||
lt_info("%s <\n", __func__);
|
lt_info("%s <\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -76,6 +76,8 @@ static const char *devname[] = {
|
|||||||
static int dmx_tp_count = 0;
|
static int dmx_tp_count = 0;
|
||||||
#define MAX_TS_COUNT 8
|
#define MAX_TS_COUNT 8
|
||||||
|
|
||||||
|
extern bool HAL_nodec;
|
||||||
|
|
||||||
cDemux::cDemux(int n)
|
cDemux::cDemux(int n)
|
||||||
{
|
{
|
||||||
if (n < 0 || n > 2)
|
if (n < 0 || n > 2)
|
||||||
@@ -383,10 +385,14 @@ bool cDemux::pesFilter(const unsigned short pid)
|
|||||||
case DMX_AUDIO_CHANNEL:
|
case DMX_AUDIO_CHANNEL:
|
||||||
p_flt.pes_type = DMX_PES_OTHER;
|
p_flt.pes_type = DMX_PES_OTHER;
|
||||||
p_flt.output = DMX_OUT_TSDEMUX_TAP;
|
p_flt.output = DMX_OUT_TSDEMUX_TAP;
|
||||||
|
if (HAL_nodec) /* no need to demux if we don't decode... */
|
||||||
|
return true;
|
||||||
break;
|
break;
|
||||||
case DMX_VIDEO_CHANNEL:
|
case DMX_VIDEO_CHANNEL:
|
||||||
p_flt.pes_type = DMX_PES_OTHER;
|
p_flt.pes_type = DMX_PES_OTHER;
|
||||||
p_flt.output = DMX_OUT_TSDEMUX_TAP;
|
p_flt.output = DMX_OUT_TSDEMUX_TAP;
|
||||||
|
if (HAL_nodec)
|
||||||
|
return true;
|
||||||
break;
|
break;
|
||||||
case DMX_PES_CHANNEL:
|
case DMX_PES_CHANNEL:
|
||||||
p_flt.pes_type = DMX_PES_OTHER;
|
p_flt.pes_type = DMX_PES_OTHER;
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
GLFramebuffer *glfb = NULL;
|
GLFramebuffer *glfb = NULL;
|
||||||
|
bool HAL_nodec = false;
|
||||||
|
|
||||||
void init_td_api()
|
void init_td_api()
|
||||||
{
|
{
|
||||||
@@ -35,6 +36,10 @@ void init_td_api()
|
|||||||
|
|
||||||
glfb = new GLFramebuffer(x, y); /* hard coded to PAL resolution for now */
|
glfb = new GLFramebuffer(x, y); /* hard coded to PAL resolution for now */
|
||||||
}
|
}
|
||||||
|
/* allow disabling of Audio/video decoders in case we just want to
|
||||||
|
* valgrind-check other parts... export HAL_NOAVDEC=1 */
|
||||||
|
if (getenv("HAL_NOAVDEC"))
|
||||||
|
HAL_nodec = true;
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,6 +50,8 @@ extern cDemux *videoDemux;
|
|||||||
extern GLFramebuffer *glfb;
|
extern GLFramebuffer *glfb;
|
||||||
int system_rev = 0;
|
int system_rev = 0;
|
||||||
|
|
||||||
|
extern bool HAL_nodec;
|
||||||
|
|
||||||
static uint8_t *dmxbuf;
|
static uint8_t *dmxbuf;
|
||||||
static int bufpos;
|
static int bufpos;
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ cVideo::cVideo(int, void *, void *)
|
|||||||
{
|
{
|
||||||
lt_debug("%s\n", __func__);
|
lt_debug("%s\n", __func__);
|
||||||
av_register_all();
|
av_register_all();
|
||||||
|
if (!HAL_nodec)
|
||||||
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
|
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
|
||||||
bufpos = 0;
|
bufpos = 0;
|
||||||
thread_running = false;
|
thread_running = false;
|
||||||
@@ -135,7 +138,7 @@ int cVideo::setCroppingMode(int)
|
|||||||
int cVideo::Start(void *, unsigned short, unsigned short, void *)
|
int cVideo::Start(void *, unsigned short, unsigned short, void *)
|
||||||
{
|
{
|
||||||
lt_info("%s running %d >\n", __func__, thread_running);
|
lt_info("%s running %d >\n", __func__, thread_running);
|
||||||
if (!thread_running)
|
if (!thread_running && !HAL_nodec)
|
||||||
OpenThreads::Thread::start();
|
OpenThreads::Thread::start();
|
||||||
lt_info("%s running %d <\n", __func__, thread_running);
|
lt_info("%s running %d <\n", __func__, thread_running);
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user