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,11 +45,14 @@ extern cDemux *audioDemux;
static uint8_t *dmxbuf = NULL;
static int bufpos;
extern bool HAL_nodec;
static cAudio *gThiz = NULL;
cAudio::cAudio(void *, void *, void *)
{
thread_started = false;
if (!HAL_nodec)
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
bufpos = 0;
curr_pts = 0;
@@ -89,6 +92,7 @@ int cAudio::setVolume(unsigned int left, unsigned int right)
int cAudio::Start(void)
{
lt_info("%s >\n", __func__);
if (! HAL_nodec)
OpenThreads::Thread::start();
lt_info("%s <\n", __func__);
return 0;

View File

@@ -76,6 +76,8 @@ static const char *devname[] = {
static int dmx_tp_count = 0;
#define MAX_TS_COUNT 8
extern bool HAL_nodec;
cDemux::cDemux(int n)
{
if (n < 0 || n > 2)
@@ -383,10 +385,14 @@ bool cDemux::pesFilter(const unsigned short pid)
case DMX_AUDIO_CHANNEL:
p_flt.pes_type = DMX_PES_OTHER;
p_flt.output = DMX_OUT_TSDEMUX_TAP;
if (HAL_nodec) /* no need to demux if we don't decode... */
return true;
break;
case DMX_VIDEO_CHANNEL:
p_flt.pes_type = DMX_PES_OTHER;
p_flt.output = DMX_OUT_TSDEMUX_TAP;
if (HAL_nodec)
return true;
break;
case DMX_PES_CHANNEL:
p_flt.pes_type = DMX_PES_OTHER;

View File

@@ -9,6 +9,7 @@
static bool initialized = false;
GLFramebuffer *glfb = NULL;
bool HAL_nodec = false;
void init_td_api()
{
@@ -35,6 +36,10 @@ void init_td_api()
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;
}

View File

@@ -50,6 +50,8 @@ extern cDemux *videoDemux;
extern GLFramebuffer *glfb;
int system_rev = 0;
extern bool HAL_nodec;
static uint8_t *dmxbuf;
static int bufpos;
@@ -66,6 +68,7 @@ cVideo::cVideo(int, void *, void *)
{
lt_debug("%s\n", __func__);
av_register_all();
if (!HAL_nodec)
dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ);
bufpos = 0;
thread_running = false;
@@ -135,7 +138,7 @@ int cVideo::setCroppingMode(int)
int cVideo::Start(void *, unsigned short, unsigned short, void *)
{
lt_info("%s running %d >\n", __func__, thread_running);
if (!thread_running)
if (!thread_running && !HAL_nodec)
OpenThreads::Thread::start();
lt_info("%s running %d <\n", __func__, thread_running);
return 0;