Move GstStartup

This commit is contained in:
Jonas Kvinge
2024-11-09 23:26:33 +01:00
parent b75410abc6
commit 975d0dff25
12 changed files with 56 additions and 100 deletions

View File

@@ -1,6 +1,6 @@
/*
* Strawberry Music Player
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,32 +20,9 @@
#ifndef GSTSTARTUP_H
#define GSTSTARTUP_H
#include "config.h"
#include <glib.h>
#include <gst/gst.h>
#include <QtGlobal>
#include <QObject>
#include <QFuture>
class GstStartup : public QObject {
Q_OBJECT
public:
explicit GstStartup(QObject *parent = nullptr);
~GstStartup() override;
void EnsureInitialized() { initializing_.waitForFinished(); }
private:
static GThread *kGThread;
static gpointer GLibMainLoopThreadFunc(gpointer data);
static void InitializeGStreamer();
static void SetEnvironment();
QFuture<void> initializing_;
};
namespace GstStartup {
void Initialize();
void SetEnvironment();
} // namespace
#endif // GSTSTARTUP_H