CScreenShot: Remove OpenThreads and use pthread functions

This commit is contained in:
M. Liebmann
2017-03-17 07:56:47 +01:00
parent 93e22163e9
commit ad47a5d5e9
2 changed files with 80 additions and 29 deletions

View File

@@ -2,6 +2,7 @@
Neutrino-GUI - DBoxII-Project
Copyright (C) 2011 CoolStream International Ltd
Copyright (C) 2017 M. Liebmann (micha-bbg)
License: GPLv2
@@ -22,9 +23,9 @@
#ifndef __screenshot_h_
#define __screenshot_h_
#include <OpenThreads/Thread>
#include <pthread.h>
class CScreenShot : public OpenThreads::Thread
class CScreenShot
{
public:
typedef enum {
@@ -43,6 +44,9 @@ class CScreenShot : public OpenThreads::Thread
bool get_video;
bool scale_to_video;
FILE *fd;
pthread_t scs_thread;
pthread_mutex_t thread_mutex;
pthread_mutex_t getData_mutex;
bool GetData();
bool OpenFile();
@@ -51,7 +55,11 @@ class CScreenShot : public OpenThreads::Thread
bool SavePng();
bool SaveJpg();
bool SaveBmp();
void run();
bool startThread();
static void* initThread(void *arg);
void runThread();
static void cleanupThread(void *arg);
public:
CScreenShot(const std::string fname = "", screenshot_format_t fmt = CScreenShot::FORMAT_JPG);