mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Refactor/Create APT/DNF Repository (#1648)
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
#pragma once
|
||||
#ifndef __APPLE__
|
||||
|
||||
/*
|
||||
* this is a mock up for compiling and testing osx wrapper on no osx platform.
|
||||
* this will show a test image and rotate the colors.
|
||||
*
|
||||
* see https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.8.sdk/System/Library/Frameworks/CoreGraphics.framework/Versions/A/Headers
|
||||
*
|
||||
*/
|
||||
|
||||
#include <utils/Image.h>
|
||||
#include <utils/ColorRgb.h>
|
||||
|
||||
enum _CGError {
|
||||
kCGErrorSuccess = 0,
|
||||
kCGErrorFailure = 1000,
|
||||
kCGErrorIllegalArgument = 1001,
|
||||
kCGErrorInvalidConnection = 1002,
|
||||
kCGErrorInvalidContext = 1003,
|
||||
kCGErrorCannotComplete = 1004,
|
||||
kCGErrorNotImplemented = 1006,
|
||||
kCGErrorRangeCheck = 1007,
|
||||
kCGErrorTypeCheck = 1008,
|
||||
kCGErrorInvalidOperation = 1010,
|
||||
kCGErrorNoneAvailable = 1011,
|
||||
|
||||
/* Obsolete errors. */
|
||||
kCGErrorNameTooLong = 1005,
|
||||
kCGErrorNoCurrentPoint = 1009,
|
||||
kCGErrorApplicationRequiresNewerSystem = 1015,
|
||||
kCGErrorApplicationNotPermittedToExecute = 1016,
|
||||
kCGErrorApplicationIncorrectExecutableFormatFound = 1023,
|
||||
kCGErrorApplicationIsLaunching = 1024,
|
||||
kCGErrorApplicationAlreadyRunning = 1025,
|
||||
kCGErrorApplicationCanOnlyBeRunInOneSessionAtATime = 1026,
|
||||
kCGErrorClassicApplicationsMustBeLaunchedByClassic = 1027,
|
||||
kCGErrorForkFailed = 1028,
|
||||
kCGErrorRetryRegistration = 1029,
|
||||
kCGErrorFirst = 1000,
|
||||
kCGErrorLast = 1029
|
||||
};
|
||||
typedef int32_t CGError;
|
||||
typedef double CGFloat;
|
||||
|
||||
struct CGSize {
|
||||
CGFloat width;
|
||||
CGFloat height;
|
||||
};
|
||||
typedef struct CGSize CGSize;
|
||||
|
||||
struct CGPoint {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
typedef struct CGPoint CGPoint;
|
||||
|
||||
struct CGRect {
|
||||
CGPoint origin;
|
||||
CGSize size;
|
||||
};
|
||||
typedef struct CGRect CGRect;
|
||||
|
||||
typedef CGError CGDisplayErr;
|
||||
typedef uint32_t CGDirectDisplayID;
|
||||
typedef uint32_t CGDisplayCount;;
|
||||
typedef struct CGDisplayMode *CGDisplayModeRef;
|
||||
|
||||
typedef Image<ColorRgb> CGImage;
|
||||
typedef CGImage* CGImageRef;
|
||||
typedef unsigned char CFData;
|
||||
typedef CFData* CFDataRef;
|
||||
|
||||
const int kCGDirectMainDisplay = 0;
|
||||
|
||||
CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount);
|
||||
CGDisplayModeRef CGDisplayCopyDisplayMode(CGDirectDisplayID display);
|
||||
CGRect CGDisplayBounds(CGDirectDisplayID display);
|
||||
void CGDisplayModeRelease(CGDisplayModeRef mode);
|
||||
|
||||
CGImageRef CGDisplayCreateImage(CGDirectDisplayID display);
|
||||
void CGImageRelease(CGImageRef image);
|
||||
CGImageRef CGImageGetDataProvider(CGImageRef image);
|
||||
CFDataRef CGDataProviderCopyData(CGImageRef image);
|
||||
unsigned char* CFDataGetBytePtr(CFDataRef imgData);
|
||||
unsigned CGImageGetWidth(CGImageRef image);
|
||||
unsigned CGImageGetHeight(CGImageRef image);
|
||||
unsigned CGImageGetBitsPerPixel(CGImageRef image);
|
||||
unsigned CGImageGetBytesPerRow(CGImageRef image);
|
||||
void CFRelease(CFDataRef imgData);
|
||||
|
||||
|
||||
#endif
|
@@ -4,7 +4,7 @@
|
||||
#include <utils/ColorBgr.h>
|
||||
#include <utils/ColorRgba.h>
|
||||
#include <hyperion/Grabber.h>
|
||||
#include <grabber/FramebufferFrameGrabber.h>
|
||||
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||
|
||||
///
|
||||
///
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/AmlogicGrabber.h>
|
||||
#include <grabber/amlogic/AmlogicGrabber.h>
|
||||
|
||||
///
|
||||
/// The Amlogic uses an instance of the AmlogicGrabber to obtain ImageRgb's from the
|
@@ -6,7 +6,7 @@
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
// Hyperion-utils includes
|
||||
#include <grabber/AudioGrabber.h>
|
||||
#include <grabber/audio/AudioGrabber.h>
|
||||
|
||||
///
|
||||
/// @brief The Linux Audio capture implementation
|
||||
@@ -18,74 +18,69 @@ class AudioGrabberLinux : public AudioGrabber
|
||||
AudioGrabberLinux();
|
||||
~AudioGrabberLinux() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Process audio buffer
|
||||
///
|
||||
void processAudioBuffer(snd_pcm_sframes_t frames);
|
||||
|
||||
///
|
||||
///
|
||||
/// Is Running Flag
|
||||
///
|
||||
std::atomic<bool> _isRunning;
|
||||
|
||||
///
|
||||
///
|
||||
/// Current capture device
|
||||
///
|
||||
snd_pcm_t * _captureDevice;
|
||||
|
||||
public slots:
|
||||
|
||||
///
|
||||
///
|
||||
/// Start audio capturing session
|
||||
///
|
||||
/// @returns true if successful
|
||||
bool start() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Stop audio capturing session
|
||||
///
|
||||
void stop() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Discovery audio devices
|
||||
///
|
||||
QJsonArray discover(const QJsonObject& params) override;
|
||||
|
||||
private:
|
||||
///
|
||||
///
|
||||
/// Refresh audio devices
|
||||
///
|
||||
void refreshDevices();
|
||||
|
||||
///
|
||||
///
|
||||
/// Configure current audio capture interface
|
||||
///
|
||||
bool configureCaptureInterface();
|
||||
|
||||
///
|
||||
///
|
||||
/// Get device name from path
|
||||
///
|
||||
QString getDeviceName(const QString& devicePath) const;
|
||||
|
||||
///
|
||||
///
|
||||
/// Current sample rate
|
||||
///
|
||||
unsigned int _sampleRate;
|
||||
|
||||
///
|
||||
///
|
||||
/// Audio capture thread
|
||||
///
|
||||
pthread_t _audioThread;
|
||||
|
||||
///
|
||||
///
|
||||
/// ALSA device configuration parameters
|
||||
///
|
||||
snd_pcm_hw_params_t * _captureDeviceConfig;
|
||||
};
|
||||
|
||||
///
|
||||
/// Audio processing thread function
|
||||
///
|
||||
static void* AudioThreadRunner(void* params);
|
||||
|
||||
#endif // AUDIOGRABBERLINUX_H
|
@@ -2,7 +2,7 @@
|
||||
#define AUDIOGRABBERWINDOWS_H
|
||||
|
||||
// Hyperion-utils includes
|
||||
#include <grabber/AudioGrabber.h>
|
||||
#include <grabber/audio/AudioGrabber.h>
|
||||
#include <DSound.h>
|
||||
|
||||
///
|
||||
@@ -14,7 +14,7 @@ class AudioGrabberWindows : public AudioGrabber
|
||||
|
||||
AudioGrabberWindows();
|
||||
~AudioGrabberWindows() override;
|
||||
|
||||
|
||||
public slots:
|
||||
bool start() override;
|
||||
void stop() override;
|
@@ -3,14 +3,14 @@
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <grabber/AudioGrabberWindows.h>
|
||||
#include <grabber/audio/AudioGrabberWindows.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <grabber/AudioGrabberLinux.h>
|
||||
#include <grabber/audio/AudioGrabberLinux.h>
|
||||
#endif
|
||||
|
||||
///
|
||||
///
|
||||
/// Audio Grabber wrapper
|
||||
///
|
||||
class AudioWrapper : public GrabberWrapper
|
||||
@@ -32,7 +32,7 @@ class AudioWrapper : public GrabberWrapper
|
||||
///
|
||||
~AudioWrapper() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Settings update handler
|
||||
///
|
||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
|
||||
@@ -43,13 +43,13 @@ class AudioWrapper : public GrabberWrapper
|
||||
///
|
||||
void action() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Start audio capturing session
|
||||
///
|
||||
/// @returns true if successful
|
||||
bool start() override;
|
||||
|
||||
///
|
||||
///
|
||||
/// Stop audio capturing session
|
||||
///
|
||||
void stop() override;
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/DirectXGrabber.h>
|
||||
#include <grabber/directx/DirectXGrabber.h>
|
||||
|
||||
class DirectXWrapper: public GrabberWrapper
|
||||
{
|
@@ -3,7 +3,7 @@
|
||||
// Utils includes
|
||||
#include <utils/ColorRgba.h>
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/DispmanxFrameGrabber.h>
|
||||
#include <grabber/dispmanx/DispmanxFrameGrabber.h>
|
||||
|
||||
///
|
||||
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain ImageRgb's from the
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/FramebufferFrameGrabber.h>
|
||||
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||
|
||||
///
|
||||
/// The FramebufferWrapper uses an instance of the FramebufferFrameGrabber to obtain ImageRgb's from the
|
@@ -1,11 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// OSX includes
|
||||
#ifdef __APPLE__
|
||||
#include <CoreGraphics/CoreGraphics.h>
|
||||
#else
|
||||
#include <grabber/OsxFrameGrabberMock.h>
|
||||
#endif
|
||||
|
||||
// Utils includes
|
||||
#include <utils/ColorRgb.h>
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/OsxFrameGrabber.h>
|
||||
#include <grabber/osx/OsxFrameGrabber.h>
|
||||
|
||||
///
|
||||
/// The OsxWrapper uses an instance of the OsxFrameGrabber to obtain ImageRgb's from the displayed content.
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/QtGrabber.h>
|
||||
#include <grabber/qt/QtGrabber.h>
|
||||
|
||||
///
|
||||
/// The QtWrapper uses QtFramework API's to get a picture from system
|
@@ -136,11 +136,11 @@ class EncoderThreadManager : public QObject
|
||||
public:
|
||||
explicit EncoderThreadManager(QObject *parent = nullptr)
|
||||
: QObject(parent)
|
||||
, _threadCount(static_cast<unsigned long>(qMax(QThread::idealThreadCount(), DEFAULT_THREAD_COUNT)))
|
||||
, _threadCount(qMax(QThread::idealThreadCount(), DEFAULT_THREAD_COUNT))
|
||||
, _threads(nullptr)
|
||||
{
|
||||
_threads = new Thread<EncoderThread>*[_threadCount];
|
||||
for (unsigned long i = 0; i < _threadCount; i++)
|
||||
for (int i = 0; i < _threadCount; i++)
|
||||
{
|
||||
_threads[i] = new Thread<EncoderThread>(new EncoderThread, this);
|
||||
_threads[i]->setObjectName("Encoder " + QString::number(i));
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
{
|
||||
if (_threads != nullptr)
|
||||
{
|
||||
for(unsigned long i = 0; i < _threadCount; i++)
|
||||
for(int i = 0; i < _threadCount; i++)
|
||||
{
|
||||
_threads[i]->deleteLater();
|
||||
_threads[i] = nullptr;
|
||||
@@ -165,18 +165,18 @@ public:
|
||||
void start()
|
||||
{
|
||||
if (_threads != nullptr)
|
||||
for (unsigned long i = 0; i < _threadCount; i++)
|
||||
for (int i = 0; i < _threadCount; i++)
|
||||
connect(_threads[i]->thread(), &EncoderThread::newFrame, this, &EncoderThreadManager::newFrame);
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
if (_threads != nullptr)
|
||||
for(unsigned long i = 0; i < _threadCount; i++)
|
||||
for(int i = 0; i < _threadCount; i++)
|
||||
disconnect(_threads[i]->thread(), nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
unsigned long _threadCount;
|
||||
int _threadCount;
|
||||
Thread<EncoderThread>** _threads;
|
||||
|
||||
signals:
|
@@ -4,9 +4,9 @@
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
|
||||
#if defined(ENABLE_MF)
|
||||
#include <grabber/MFGrabber.h>
|
||||
#include <grabber/video/mediafoundation/MFGrabber.h>
|
||||
#elif defined(ENABLE_V4L2)
|
||||
#include <grabber/V4L2Grabber.h>
|
||||
#include <grabber/video/v4l2/V4L2Grabber.h>
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_CEC)
|
@@ -21,7 +21,7 @@
|
||||
#include <hyperion/Grabber.h>
|
||||
|
||||
// decoder thread includes
|
||||
#include <grabber/EncoderThread.h>
|
||||
#include <grabber/video/EncoderThread.h>
|
||||
|
||||
/// Forward class declaration
|
||||
class SourceReaderCB;
|
@@ -19,7 +19,7 @@
|
||||
#include <utils/Components.h>
|
||||
|
||||
// decoder thread includes
|
||||
#include <grabber/EncoderThread.h>
|
||||
#include <grabber/video/EncoderThread.h>
|
||||
|
||||
// Determine the cmake options
|
||||
#include <HyperionConfig.h>
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/X11Grabber.h>
|
||||
#include <grabber/x11/X11Grabber.h>
|
||||
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
||||
#ifdef None
|
||||
#undef None
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/XcbGrabber.h>
|
||||
#include <grabber/xcb/XcbGrabber.h>
|
||||
|
||||
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
||||
#ifdef None
|
Reference in New Issue
Block a user