From c37263f594747fdd36f8c941cacf18386f785658 Mon Sep 17 00:00:00 2001 From: smogm Date: Sun, 11 Jan 2015 18:12:55 +0100 Subject: [PATCH] add changed files --- common/Makefile.am | 2 ++ common/thread_abstraction.cpp | 1 + generic-pc/Makefile.am | 1 - generic-pc/audio.cpp | 5 ++--- generic-pc/audio_lib.h | 4 ++-- generic-pc/glfb.cpp | 4 ++-- generic-pc/glfb.h | 9 +++++---- generic-pc/video.cpp | 4 ++-- generic-pc/video_lib.h | 9 +++++---- 9 files changed, 21 insertions(+), 18 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 200d2f5..328f5ef 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -18,5 +18,7 @@ libcommon_la_SOURCES = \ endif libcommon_la_SOURCES += \ + thread_abstraction.cpp \ + mutex_abstraction.cpp \ lt_debug.cpp \ proc_tools.c diff --git a/common/thread_abstraction.cpp b/common/thread_abstraction.cpp index 57b7759..271755c 100644 --- a/common/thread_abstraction.cpp +++ b/common/thread_abstraction.cpp @@ -30,4 +30,5 @@ void Thread::joinThread() void* Thread::runThread(void* ptr) { ((Thread*)ptr)->run(); + return 0; } diff --git a/generic-pc/Makefile.am b/generic-pc/Makefile.am index 67fbc95..9cf026f 100644 --- a/generic-pc/Makefile.am +++ b/generic-pc/Makefile.am @@ -8,7 +8,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_LDFLAGS = \ -lglut -lGL -lGLU -lGLEW -lao \ - -lOpenThreads \ @AVFORMAT_LIBS@ \ @AVUTIL_LIBS@ \ @AVCODEC_LIBS@ \ diff --git a/generic-pc/audio.cpp b/generic-pc/audio.cpp index 8d6f317..5e7e7ad 100644 --- a/generic-pc/audio.cpp +++ b/generic-pc/audio.cpp @@ -29,7 +29,6 @@ #define lt_debug(args...) _lt_debug(HAL_DEBUG_AUDIO, this, args) #define lt_info(args...) _lt_info(HAL_DEBUG_AUDIO, this, args) -#include extern "C" { #include @@ -104,7 +103,7 @@ int cAudio::Start(void) { lt_debug("%s >\n", __func__); if (! HAL_nodec) - OpenThreads::Thread::start(); + startThread(); lt_debug("%s <\n", __func__); return 0; } @@ -115,7 +114,7 @@ int cAudio::Stop(void) if (thread_started) { thread_started = false; - OpenThreads::Thread::join(); + joinThread(); } lt_debug("%s <\n", __func__); return 0; diff --git a/generic-pc/audio_lib.h b/generic-pc/audio_lib.h index 36ad41a..86d4806 100644 --- a/generic-pc/audio_lib.h +++ b/generic-pc/audio_lib.h @@ -4,7 +4,7 @@ #define _AUDIO_LIB_H_ #include -#include +#include "../common/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 OpenThreads::Thread +class cAudio : public Thread { friend class cPlayback; private: diff --git a/generic-pc/glfb.cpp b/generic-pc/glfb.cpp index fd48705..460777c 100644 --- a/generic-pc/glfb.cpp +++ b/generic-pc/glfb.cpp @@ -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(); - OpenThreads::Thread::start(); + startThread(); while (!mInitDone) usleep(1); } @@ -105,7 +105,7 @@ GLFramebuffer::GLFramebuffer(int x, int y): mReInit(true), mShutDown(false), mIn GLFramebuffer::~GLFramebuffer() { mShutDown = true; - OpenThreads::Thread::join(); + joinThread(); if (input_fd >= 0) close(input_fd); } diff --git a/generic-pc/glfb.h b/generic-pc/glfb.h index 78376ba..aa4017d 100644 --- a/generic-pc/glfb.h +++ b/generic-pc/glfb.h @@ -18,8 +18,9 @@ #ifndef __glthread__ #define __glthread__ -#include -#include +#include "../common/thread_abstraction.h" +#include "../common/mutex_abstraction.h" + #include #include #include @@ -30,7 +31,7 @@ extern "C" { #include } -class GLFramebuffer : public OpenThreads::Thread +class GLFramebuffer : public Thread { public: GLFramebuffer(int x, int y); @@ -66,7 +67,7 @@ private: bool mFullscreen; /* fullscreen? */ bool mReInit; /* setup things for GL */ - OpenThreads::Mutex mReInitLock; + Mutex mReInitLock; bool mShutDown; /* if set main loop is left */ bool mInitDone; /* condition predicate */ // OpenThreads::Condition mInitCond; /* condition variable for init */ diff --git a/generic-pc/video.cpp b/generic-pc/video.cpp index cf9e9cb..4ca5d8b 100644 --- a/generic-pc/video.cpp +++ b/generic-pc/video.cpp @@ -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) - OpenThreads::Thread::start(); + 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; - OpenThreads::Thread::join(); + joinThread(); } lt_debug("%s running %d <\n", __func__, thread_running); return 0; diff --git a/generic-pc/video_lib.h b/generic-pc/video_lib.h index 077154c..3d3d7f2 100644 --- a/generic-pc/video_lib.h +++ b/generic-pc/video_lib.h @@ -1,8 +1,8 @@ #ifndef _VIDEO_TD_H #define _VIDEO_TD_H -#include -#include +#include "../common/thread_abstraction.h" +#include "../common/mutex_abstraction.h" #include #include #include "../common/cs_types.h" @@ -120,7 +120,7 @@ typedef enum #define VDEC_MAXBUFS 0x30 -class cVideo : public OpenThreads::Thread +class cVideo : public Thread { friend class GLFramebuffer; friend class cDemux; @@ -207,7 +207,8 @@ class cVideo : public OpenThreads::Thread bool thread_running; VIDEO_FORMAT v_format; VIDEO_STD v_std; - OpenThreads::Mutex buf_m; + //OpenThreads::Mutex buf_m; + Mutex buf_m; DISPLAY_AR display_aspect; DISPLAY_AR_MODE display_crop; int output_h;