generic-pc: allow to disable softdecoder for debugging

This commit is contained in:
Stefan Seyfried
2013-05-10 13:37:24 +02:00
parent 6724f3f9e3
commit 5f0fb850d6
4 changed files with 22 additions and 4 deletions

View File

@@ -45,12 +45,15 @@ 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;
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ); if (!HAL_nodec)
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
bufpos = 0; bufpos = 0;
curr_pts = 0; curr_pts = 0;
gThiz = this; gThiz = this;
@@ -89,7 +92,8 @@ 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__);
OpenThreads::Thread::start(); if (! HAL_nodec)
OpenThreads::Thread::start();
lt_info("%s <\n", __func__); lt_info("%s <\n", __func__);
return 0; return 0;
} }

View File

@@ -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;

View File

@@ -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;
} }

View File

@@ -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,7 +68,8 @@ cVideo::cVideo(int, void *, void *)
{ {
lt_debug("%s\n", __func__); lt_debug("%s\n", __func__);
av_register_all(); av_register_all();
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ); if (!HAL_nodec)
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
bufpos = 0; bufpos = 0;
thread_running = false; thread_running = false;
w_h_changed = false; w_h_changed = 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;