move libthread to libstb-hal

This commit is contained in:
smogm
2015-01-12 18:15:08 +01:00
parent 3ef2eeb8aa
commit 95ee7f9e98
25 changed files with 915 additions and 86 deletions

View File

@@ -2,6 +2,7 @@ noinst_LTLIBRARIES = libgeneric.la
AM_CPPFLAGS = -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
AM_CPPFLAGS += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing

View File

@@ -103,7 +103,7 @@ int cAudio::Start(void)
{
lt_debug("%s >\n", __func__);
if (! HAL_nodec)
SimpleThread::startThread();
Thread::startThread();
lt_debug("%s <\n", __func__);
return 0;
}
@@ -114,7 +114,7 @@ int cAudio::Stop(void)
if (thread_started)
{
thread_started = false;
SimpleThread::joinThread();
Thread::joinThread();
}
lt_debug("%s <\n", __func__);
return 0;

View File

@@ -4,7 +4,7 @@
#define _AUDIO_LIB_H_
#include <stdint.h>
#include "../common/thread_abstraction.h"
#include <thread_abstraction.h>
#include "../common/cs_types.h"
typedef enum
@@ -38,7 +38,7 @@ typedef enum
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
} AUDIO_FORMAT;
class cAudio : public SimpleThread
class cAudio : public Thread
{
friend class cPlayback;
private:

View File

@@ -70,12 +70,15 @@ static const char *DMX_T[] = {
};
/* map the device numbers. for now only demux0 is used */
static const char *devname[] = {
#define NUM_DEMUXDEV 1
static const char *devname[NUM_DEMUXDEV] = {
"/dev/dvb/adapter0/demux0",
"/dev/dvb/adapter0/demux0",
"/dev/dvb/adapter0/demux0"
};
#define NUM_DEMUX 1
static int dmx_source[NUM_DEMUX] = { 0 };
static bool init[NUM_DEMUXDEV] = { false };
/* uuuugly */
static int dmx_tp_count = 0;
#define MAX_TS_COUNT 8
@@ -494,12 +497,28 @@ int cDemux::getUnit(void)
bool cDemux::SetSource(int unit, int source)
{
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
//lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
//return true;
if (unit >= NUM_DEMUX || unit < 0) {
lt_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return false;
}
lt_info_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);
else
dmx_source[unit] = source;
return true;
}
int cDemux::GetSource(int unit)
{
lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
return 0;
//lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
//return 0;
if (unit >= NUM_DEMUX || unit < 0) {
lt_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return -1;
}
lt_info_c("%s(%d) => %d\n", __func__, unit, dmx_source[unit]);
return dmx_source[unit];
}

View File

@@ -97,7 +97,7 @@ GLFramebuffer::GLFramebuffer(int x, int y): mReInit(true), mShutDown(false), mIn
if (input_fd < 0)
lt_info("%s: could not open /tmp/neutrino.input FIFO: %m\n", __func__);
initKeys();
SimpleThread::startThread();
Thread::startThread();
while (!mInitDone)
usleep(1);
}
@@ -105,7 +105,7 @@ GLFramebuffer::GLFramebuffer(int x, int y): mReInit(true), mShutDown(false), mIn
GLFramebuffer::~GLFramebuffer()
{
mShutDown = true;
SimpleThread::joinThread();
Thread::joinThread();
if (input_fd >= 0)
close(input_fd);
}

View File

@@ -18,8 +18,8 @@
#ifndef __glthread__
#define __glthread__
#include "../common/thread_abstraction.h"
#include "../common/mutex_abstraction.h"
#include <thread_abstraction.h>
#include <mutex_abstraction.h>
#include <vector>
#include <map>
@@ -31,7 +31,7 @@ extern "C" {
#include <libavutil/rational.h>
}
class GLFramebuffer : public SimpleThread
class GLFramebuffer : public Thread
{
public:
GLFramebuffer(int x, int y);

View File

@@ -141,7 +141,7 @@ int cVideo::Start(void *, unsigned short, unsigned short, void *)
{
lt_debug("%s running %d >\n", __func__, thread_running);
if (!thread_running && !HAL_nodec)
SimpleThread::startThread();
Thread::startThread();
lt_debug("%s running %d <\n", __func__, thread_running);
return 0;
}
@@ -151,7 +151,7 @@ int cVideo::Stop(bool)
lt_debug("%s running %d >\n", __func__, thread_running);
if (thread_running) {
thread_running = false;
SimpleThread::joinThread();
Thread::joinThread();
}
lt_debug("%s running %d <\n", __func__, thread_running);
return 0;

View File

@@ -1,8 +1,8 @@
#ifndef _VIDEO_TD_H
#define _VIDEO_TD_H
#include "../common/thread_abstraction.h"
#include "../common/mutex_abstraction.h"
#include <thread_abstraction.h>
#include <mutex_abstraction.h>
#include <vector>
#include <linux/dvb/video.h>
#include "../common/cs_types.h"
@@ -120,7 +120,7 @@ typedef enum
#define VDEC_MAXBUFS 0x30
class cVideo : public SimpleThread
class cVideo : public Thread
{
friend class GLFramebuffer;
friend class cDemux;