4#ifndef QGSTREAMERAUDIODECODERCONTROL_H
5#define QGSTREAMERAUDIODECODERCONTROL_H
18#include <QtMultimedia/private/qmultimediautils_p.h>
19#include <QtMultimedia/private/qplatformaudiodecoder_p.h>
20#include <QtMultimedia/private/qtmultimediaglobal_p.h>
21#include <QtMultimedia/qaudiodecoder.h>
22#include <QtCore/qobject.h>
23#include <QtCore/qmutex.h>
24#include <QtCore/qurl.h>
25#include <QtCore/private/qexpected_p.h>
27#include <common/qgst_p.h>
28#include <common/qgst_bus_observer_p.h>
29#include <common/qgstpipeline_p.h>
31#include <gst/app/gstappsink.h>
46 void setSource(
const QUrl &fileName)
override;
68 explicit QGstreamerAudioDecoder(QAudioDecoder *parent);
70 static GstFlowReturn new_sample(GstAppSink *sink, gpointer user_data);
71 GstFlowReturn newSample(GstAppSink *sink);
73 void setAudioFlags(
bool wantNativeAudio);
77 void processInvalidMedia(QAudioDecoder::Error errorCode,
const QString &errorString);
78 static std::chrono::nanoseconds getPositionFromBuffer(GstBuffer *buffer);
94 QIODevice *mDevice =
nullptr;
97 int m_buffersAvailable = 0;
99 int m_durationQueries = 0;
101 qint32 m_currentSessionId{};
void setSourceDevice(QIODevice *device) override
QAudioFormat audioFormat() const override
~QGstreamerAudioDecoder() override
QIODevice * sourceDevice() const override
void setSource(const QUrl &fileName) override
static q23::expected< QPlatformAudioDecoder *, QString > create(QAudioDecoder *parent)
QUrl source() const override
void setAudioFormat(const QAudioFormat &format) override
QAudioBuffer read() override
bool processBusMessage(const QGstreamerMessage &message) override
bool canReadQrc() const override
QGstCaps capsForAudioFormat(const QAudioFormat &format)
Combined button and popup list for selecting options.
@ GST_PLAY_FLAG_SOFT_VOLUME
@ GST_PLAY_FLAG_BUFFERING
@ GST_PLAY_FLAG_NATIVE_AUDIO
@ GST_PLAY_FLAG_NATIVE_VIDEO
QCompactGstMessageAdaptor(const QGstreamerMessage &m)