1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QUEUEWORKER_H
#define QUEUEWORKER_H
#include "remotemedia.h"
#include <QObject>
#include <QQueue>
#include <QSet>
class QueueWorker : public QObject
{
Q_OBJECT
public:
explicit QueueWorker();
void abort();
signals:
void processing(int index);
void dropped(int index);
void dataFetched(int index, MediaElement element);
void triggerQueueProcessing(QPrivateSignal); // signal to self, see implementation of fetchData()
public slots:
void fetchData(int index);
private slots:
void processQueue();
private:
void sendTriggerQueueProcessingSignal(int index);
RemoteMedia m_remoteMedia;
QSet<int> m_indicesAlreadyFetched;
QQueue<int> m_indicesToFetch;
std::atomic<bool> m_killSignalReceived{false};
bool m_queueProcessingSignalSent{false};
};
#endif // QUEUEWORKER_H
|