mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-20 21:43:12 -07:00
Move Chiaki Session to StreamSession
This commit is contained in:
parent
c5bb81c015
commit
49e7143de9
5 changed files with 157 additions and 123 deletions
|
@ -18,21 +18,45 @@
|
|||
#ifndef CHIAKI_STREAMSESSION_H
|
||||
#define CHIAKI_STREAMSESSION_H
|
||||
|
||||
#include "videodecoder.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QGamepad>
|
||||
#include <QImage>
|
||||
|
||||
#include <chiaki/session.h>
|
||||
|
||||
class QGamepad;
|
||||
class QAudioOutput;
|
||||
class QIODevice;
|
||||
|
||||
class StreamSession : public QObject
|
||||
{
|
||||
friend class StreamSessionPrivate;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
ChiakiSession session;
|
||||
|
||||
QGamepad *gamepad;
|
||||
|
||||
VideoDecoder video_decoder;
|
||||
|
||||
QAudioOutput *audio_output;
|
||||
QIODevice *audio_io;
|
||||
|
||||
void PushAudioFrame(int16_t *buf, size_t samples_count);
|
||||
void PushVideoSample(uint8_t *buf, size_t buf_size);
|
||||
|
||||
public:
|
||||
explicit StreamSession(QObject *parent = nullptr);
|
||||
explicit StreamSession(const QString &host, const QString ®istkey, const QString &ostype, const QString &auth, const QString &morning, const QString &did, QObject *parent = nullptr);
|
||||
~StreamSession();
|
||||
|
||||
QGamepad *GetGamepad() { return gamepad; }
|
||||
VideoDecoder *GetVideoDecoder() { return &video_decoder; }
|
||||
|
||||
signals:
|
||||
void CurrentImageUpdated();
|
||||
|
||||
private slots:
|
||||
void UpdateGamepads();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue