mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
add changed files
This commit is contained in:
@@ -18,5 +18,7 @@ libcommon_la_SOURCES = \
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
libcommon_la_SOURCES += \
|
libcommon_la_SOURCES += \
|
||||||
|
thread_abstraction.cpp \
|
||||||
|
mutex_abstraction.cpp \
|
||||||
lt_debug.cpp \
|
lt_debug.cpp \
|
||||||
proc_tools.c
|
proc_tools.c
|
||||||
|
@@ -30,4 +30,5 @@ void Thread::joinThread()
|
|||||||
void* Thread::runThread(void* ptr)
|
void* Thread::runThread(void* ptr)
|
||||||
{
|
{
|
||||||
((Thread*)ptr)->run();
|
((Thread*)ptr)->run();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
|||||||
|
|
||||||
AM_LDFLAGS = \
|
AM_LDFLAGS = \
|
||||||
-lglut -lGL -lGLU -lGLEW -lao \
|
-lglut -lGL -lGLU -lGLEW -lao \
|
||||||
-lOpenThreads \
|
|
||||||
@AVFORMAT_LIBS@ \
|
@AVFORMAT_LIBS@ \
|
||||||
@AVUTIL_LIBS@ \
|
@AVUTIL_LIBS@ \
|
||||||
@AVCODEC_LIBS@ \
|
@AVCODEC_LIBS@ \
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
#define lt_debug(args...) _lt_debug(HAL_DEBUG_AUDIO, this, args)
|
#define lt_debug(args...) _lt_debug(HAL_DEBUG_AUDIO, this, args)
|
||||||
#define lt_info(args...) _lt_info(HAL_DEBUG_AUDIO, this, args)
|
#define lt_info(args...) _lt_info(HAL_DEBUG_AUDIO, this, args)
|
||||||
|
|
||||||
#include <OpenThreads/Thread>
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
@@ -104,7 +103,7 @@ int cAudio::Start(void)
|
|||||||
{
|
{
|
||||||
lt_debug("%s >\n", __func__);
|
lt_debug("%s >\n", __func__);
|
||||||
if (! HAL_nodec)
|
if (! HAL_nodec)
|
||||||
OpenThreads::Thread::start();
|
startThread();
|
||||||
lt_debug("%s <\n", __func__);
|
lt_debug("%s <\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -115,7 +114,7 @@ int cAudio::Stop(void)
|
|||||||
if (thread_started)
|
if (thread_started)
|
||||||
{
|
{
|
||||||
thread_started = false;
|
thread_started = false;
|
||||||
OpenThreads::Thread::join();
|
joinThread();
|
||||||
}
|
}
|
||||||
lt_debug("%s <\n", __func__);
|
lt_debug("%s <\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#define _AUDIO_LIB_H_
|
#define _AUDIO_LIB_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <OpenThreads/Thread>
|
#include "../common/thread_abstraction.h"
|
||||||
#include "../common/cs_types.h"
|
#include "../common/cs_types.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
@@ -38,7 +38,7 @@ typedef enum
|
|||||||
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
|
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
|
||||||
} AUDIO_FORMAT;
|
} AUDIO_FORMAT;
|
||||||
|
|
||||||
class cAudio : public OpenThreads::Thread
|
class cAudio : public Thread
|
||||||
{
|
{
|
||||||
friend class cPlayback;
|
friend class cPlayback;
|
||||||
private:
|
private:
|
||||||
|
@@ -97,7 +97,7 @@ GLFramebuffer::GLFramebuffer(int x, int y): mReInit(true), mShutDown(false), mIn
|
|||||||
if (input_fd < 0)
|
if (input_fd < 0)
|
||||||
lt_info("%s: could not open /tmp/neutrino.input FIFO: %m\n", __func__);
|
lt_info("%s: could not open /tmp/neutrino.input FIFO: %m\n", __func__);
|
||||||
initKeys();
|
initKeys();
|
||||||
OpenThreads::Thread::start();
|
startThread();
|
||||||
while (!mInitDone)
|
while (!mInitDone)
|
||||||
usleep(1);
|
usleep(1);
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ GLFramebuffer::GLFramebuffer(int x, int y): mReInit(true), mShutDown(false), mIn
|
|||||||
GLFramebuffer::~GLFramebuffer()
|
GLFramebuffer::~GLFramebuffer()
|
||||||
{
|
{
|
||||||
mShutDown = true;
|
mShutDown = true;
|
||||||
OpenThreads::Thread::join();
|
joinThread();
|
||||||
if (input_fd >= 0)
|
if (input_fd >= 0)
|
||||||
close(input_fd);
|
close(input_fd);
|
||||||
}
|
}
|
||||||
|
@@ -18,8 +18,9 @@
|
|||||||
|
|
||||||
#ifndef __glthread__
|
#ifndef __glthread__
|
||||||
#define __glthread__
|
#define __glthread__
|
||||||
#include <OpenThreads/Thread>
|
#include "../common/thread_abstraction.h"
|
||||||
#include <OpenThreads/Mutex>
|
#include "../common/mutex_abstraction.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
@@ -30,7 +31,7 @@ extern "C" {
|
|||||||
#include <libavutil/rational.h>
|
#include <libavutil/rational.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
class GLFramebuffer : public OpenThreads::Thread
|
class GLFramebuffer : public Thread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GLFramebuffer(int x, int y);
|
GLFramebuffer(int x, int y);
|
||||||
@@ -66,7 +67,7 @@ private:
|
|||||||
|
|
||||||
bool mFullscreen; /* fullscreen? */
|
bool mFullscreen; /* fullscreen? */
|
||||||
bool mReInit; /* setup things for GL */
|
bool mReInit; /* setup things for GL */
|
||||||
OpenThreads::Mutex mReInitLock;
|
Mutex mReInitLock;
|
||||||
bool mShutDown; /* if set main loop is left */
|
bool mShutDown; /* if set main loop is left */
|
||||||
bool mInitDone; /* condition predicate */
|
bool mInitDone; /* condition predicate */
|
||||||
// OpenThreads::Condition mInitCond; /* condition variable for init */
|
// OpenThreads::Condition mInitCond; /* condition variable for init */
|
||||||
|
@@ -141,7 +141,7 @@ int cVideo::Start(void *, unsigned short, unsigned short, void *)
|
|||||||
{
|
{
|
||||||
lt_debug("%s running %d >\n", __func__, thread_running);
|
lt_debug("%s running %d >\n", __func__, thread_running);
|
||||||
if (!thread_running && !HAL_nodec)
|
if (!thread_running && !HAL_nodec)
|
||||||
OpenThreads::Thread::start();
|
startThread();
|
||||||
lt_debug("%s running %d <\n", __func__, thread_running);
|
lt_debug("%s running %d <\n", __func__, thread_running);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ int cVideo::Stop(bool)
|
|||||||
lt_debug("%s running %d >\n", __func__, thread_running);
|
lt_debug("%s running %d >\n", __func__, thread_running);
|
||||||
if (thread_running) {
|
if (thread_running) {
|
||||||
thread_running = false;
|
thread_running = false;
|
||||||
OpenThreads::Thread::join();
|
joinThread();
|
||||||
}
|
}
|
||||||
lt_debug("%s running %d <\n", __func__, thread_running);
|
lt_debug("%s running %d <\n", __func__, thread_running);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef _VIDEO_TD_H
|
#ifndef _VIDEO_TD_H
|
||||||
#define _VIDEO_TD_H
|
#define _VIDEO_TD_H
|
||||||
|
|
||||||
#include <OpenThreads/Thread>
|
#include "../common/thread_abstraction.h"
|
||||||
#include <OpenThreads/Mutex>
|
#include "../common/mutex_abstraction.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <linux/dvb/video.h>
|
#include <linux/dvb/video.h>
|
||||||
#include "../common/cs_types.h"
|
#include "../common/cs_types.h"
|
||||||
@@ -120,7 +120,7 @@ typedef enum
|
|||||||
|
|
||||||
|
|
||||||
#define VDEC_MAXBUFS 0x30
|
#define VDEC_MAXBUFS 0x30
|
||||||
class cVideo : public OpenThreads::Thread
|
class cVideo : public Thread
|
||||||
{
|
{
|
||||||
friend class GLFramebuffer;
|
friend class GLFramebuffer;
|
||||||
friend class cDemux;
|
friend class cDemux;
|
||||||
@@ -207,7 +207,8 @@ class cVideo : public OpenThreads::Thread
|
|||||||
bool thread_running;
|
bool thread_running;
|
||||||
VIDEO_FORMAT v_format;
|
VIDEO_FORMAT v_format;
|
||||||
VIDEO_STD v_std;
|
VIDEO_STD v_std;
|
||||||
OpenThreads::Mutex buf_m;
|
//OpenThreads::Mutex buf_m;
|
||||||
|
Mutex buf_m;
|
||||||
DISPLAY_AR display_aspect;
|
DISPLAY_AR display_aspect;
|
||||||
DISPLAY_AR_MODE display_crop;
|
DISPLAY_AR_MODE display_crop;
|
||||||
int output_h;
|
int output_h;
|
||||||
|
Reference in New Issue
Block a user