Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqnxmediaplayer.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion
2// Copyright (C) 2021 The Qt Company
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4#include "qqnxmediaplayer_p.h"
5#include "qqnxvideosink_p.h"
6#include "qqnxmediautil_p.h"
9
10#include <private/qabstractvideobuffer_p.h>
11
12#include <QtCore/qabstracteventdispatcher.h>
13#include <QtCore/qcoreapplication.h>
14#include <QtCore/qdir.h>
15#include <QtCore/qfileinfo.h>
16#include <QtCore/quuid.h>
17#include <mm/renderer.h>
18#include <qmediaplayer.h>
19#include <qqnxaudiooutput_p.h>
20#include <qaudiooutput.h>
21
22#include <errno.h>
23#include <sys/strm.h>
24#include <sys/stat.h>
25
26#include <algorithm>
27#include <tuple>
28
29static constexpr int rateToSpeed(qreal rate)
30{
31 return std::floor(rate * 1000);
32}
33
34static constexpr qreal speedToRate(int speed)
35{
36 return std::floor(speed / 1000.0);
37}
38
39static constexpr int normalizeVolume(float volume)
40{
41 return std::clamp<int>(std::floor(volume * 100.0), 0, 100);
42}
43
44static std::tuple<int, int, bool> parseBufferLevel(const QString &value)
45{
46 if (value.isEmpty())
47 return {};
48
49 const int slashPos = value.indexOf('/');
50 if (slashPos <= 0)
51 return {};
52
53 bool ok = false;
54 const int level = value.left(slashPos).toInt(&ok);
55 if (!ok || level < 0)
56 return {};
57
58 const int capacity = value.mid(slashPos + 1).toInt(&ok);
59 if (!ok || capacity < 0)
60 return {};
61
62 return { level, capacity, true };
63}
64
66{
67public:
69 : QAbstractVideoBuffer(QVideoFrame::RhiTextureHandle)
70 {
71 m_windowGrabber = QQnxWindowGrabber;
72 m_handle = 0;
73 }
74
76 {
78 }
79
80 void unmap() override {}
81
82 MapData map(QVideoFrame::MapMode /*mode*/) override
83 {
84 return {};
85 }
86
87 quint64 textureHandle(QRhi *, int plane) const override
88 {
89 if (plane != 0)
90 return 0;
91 if (!m_handle) {
92 const_cast<QnxTextureBuffer*>(this)->m_handle = m_windowGrabber->getNextTextureId();
93 }
94 return m_handle;
95 }
96
97private:
98 QQnxWindowGrabber *m_windowGrabber;
99 quint64 m_handle;
100};
101
103{
104public:
107 {
108 m_windowGrabber = windowGrabber;
109 }
110
112 {
114 }
115
117 {
118 if (buffer.data) {
119 qWarning("QnxRasterBuffer: need to unmap before mapping");
120 return {};
121 }
122
123 buffer = m_windowGrabber->getNextBuffer();
124
125 return {
126 .nPlanes = 1,
127 .bytesPerLine = { buffer.stride },
128 .data = { buffer.data },
129 .size = { buffer.width * buffer.height * buffer.pixelSize }
130 };
131 }
132
133 void unmap() override
134 {
135 buffer = {};
136 }
137
138private:
139 QQnxWindowGrabber *m_windowGrabber;
141};
142
144
146 : QObject(parent)
147 , QPlatformMediaPlayer(parent)
148 , m_windowGrabber(new QQnxWindowGrabber(this))
149{
150 m_flushPositionTimer.setSingleShot(true);
151 m_flushPositionTimer.setInterval(100);
152
153 connect(&m_flushPositionTimer, &QTimer::timeout, this, &QQnxMediaPlayer::flushPosition);
154
155 connect(m_windowGrabber, &QQnxWindowGrabber::updateScene, this, &QQnxMediaPlayer::updateScene);
156
157 openConnection();
158}
159
161{
162 stop();
163 detach();
164 closeConnection();
165}
166
167void QQnxMediaPlayer::openConnection()
168{
169 static int idCounter = 0;
170
171 m_connection = mmr_connect(nullptr);
172 if (!m_connection) {
173 emitPError(QString::fromLatin1("Unable to connect to the multimedia renderer"));
174 return;
175 }
176
177 m_id = idCounter++;
178 m_contextName = QString::fromLatin1("QQnxMediaPlayer_%1_%2").arg(m_id)
180 m_context = mmr_context_create(m_connection, m_contextName.toLatin1(),
181 0, S_IRWXU|S_IRWXG|S_IRWXO);
182 if (!m_context) {
183 emitPError(QString::fromLatin1("Unable to create context"));
184 closeConnection();
185 return;
186 }
187
188 startMonitoring();
189}
190
191void QQnxMediaPlayer::handleMmEventState(const mmr_event_t *event)
192{
193 if (!event || event->type != MMR_EVENT_STATE)
194 return;
195
196 switch (event->state) {
198 break;
199 case MMR_STATE_IDLE:
202 detachVideoOutput();
203 detachInput();
204 break;
207 m_windowGrabber->stop();
208
209 if (m_platformVideoSink)
210 m_platformVideoSink->setVideoFrame({});
211 break;
213 if (event->speed == 0) {
215 m_windowGrabber->pause();
216 } else if (state() == QMediaPlayer::PausedState) {
217 m_windowGrabber->resume();
219 } else {
220 m_windowGrabber->start();
222 }
223
224 if (event->speed != m_speed) {
225 m_speed = event->speed;
226
228 m_configuredSpeed = m_speed;
229
231 }
232 break;
233 }
234}
235
236void QQnxMediaPlayer::handleMmEventStatus(const mmr_event_t *event)
237{
238 if (!event || event->type != MMR_EVENT_STATUS)
239 return;
240
241 if (event->data)
242 handleMmEventStatusData(event->data);
243
244 // update pos
245 if (!event->pos_str || isPendingPositionFlush())
246 return;
247
248 const QByteArray valueBa(event->pos_str);
249
250 bool ok;
251 const qint64 position = valueBa.toLongLong(&ok);
252
253 if (!ok)
254 qCritical("Could not parse position from '%s'", valueBa.constData());
255 else
256 handleMmPositionChanged(position);
257}
258
259void QQnxMediaPlayer::handleMmEventStatusData(const strm_dict_t *data)
260{
261 if (!data)
262 return;
263
264 const auto getValue = [data](const char *key) -> QString {
265 const strm_string_t *value = strm_dict_find_rstr(data, key);
266
267 if (!value)
268 return {};
269
270 return QString::fromUtf8(strm_string_get(value));
271 };
272
273 // update bufferProgress
274 const QString bufferLevel = getValue("bufferlevel");
275
276 if (!bufferLevel.isEmpty()) {
277 const auto & [level, capacity, ok] = ::parseBufferLevel(bufferLevel);
278
279 if (ok)
280 updateBufferLevel(level, capacity);
281 else
282 qCritical("Could not parse buffer capacity from '%s'", qUtf8Printable(bufferLevel));
283 }
284
285 // update MediaStatus
286 const QString bufferStatus = getValue("bufferstatus");
287 const QString suspended = getValue("suspended");
288
289 if (suspended == QStringLiteral("yes"))
291 else if (bufferStatus == QStringLiteral("buffering"))
293 else if (bufferStatus == QStringLiteral("playing"))
295}
296
297void QQnxMediaPlayer::handleMmEventError(const mmr_event_t *event)
298{
299 if (!event)
300 return;
301
302 // When playback is explicitly stopped using mmr_stop(), mm-renderer
303 // generates a STATE event. When the end of media is reached, an ERROR
304 // event is generated and the error code contained in the event information
305 // is set to MMR_ERROR_NONE. When an error causes playback to stop,
306 // the error code is set to something else.
307 if (event->details.error.info.error_code == MMR_ERROR_NONE) {
310 }
311}
312
313void QQnxMediaPlayer::closeConnection()
314{
315 stopMonitoring();
316
317 if (m_context) {
318 mmr_context_destroy(m_context);
319 m_context = nullptr;
320 m_contextName.clear();
321 }
322
323 if (m_connection) {
324 mmr_disconnect(m_connection);
325 m_connection = nullptr;
326 }
327}
328
329QByteArray QQnxMediaPlayer::resourcePathForUrl(const QUrl &url)
330{
331 // If this is a local file, mmrenderer expects the file:// prefix and an absolute path.
332 // We treat URLs without scheme as local files, most likely someone just forgot to set the
333 // file:// prefix when constructing the URL.
334 if (url.isLocalFile() || url.scheme().isEmpty()) {
335 const QString relativeFilePath = url.scheme().isEmpty() ? url.path() : url.toLocalFile();
336 const QFileInfo fileInfo(relativeFilePath);
337 return QFile::encodeName(QStringLiteral("file://") + fileInfo.absoluteFilePath());
338
339 // HTTP or similar URL
340 } else {
341 return url.toEncoded();
342 }
343}
344
345void QQnxMediaPlayer::attach()
346{
347 // Should only be called in detached state
348 if (isInputAttached())
349 return;
350
351 if (!m_media.isValid() || !m_context) {
353 return;
354 }
355
356 resetMonitoring();
357
358 if (!(attachVideoOutput() && attachAudioOutput() && attachInput())) {
359 detach();
360 return;
361 }
362
364}
365
366bool QQnxMediaPlayer::attachVideoOutput()
367{
368 if (isVideoOutputAttached()) {
369 qWarning() << "QQnxMediaPlayer: Video output already attached!";
370 return true;
371 }
372
373 if (!m_context) {
374 qWarning() << "QQnxMediaPlayer: No media player context!";
375 return false;
376 }
377
378 const QByteArray windowGroupId = m_windowGrabber->windowGroupId();
379 if (windowGroupId.isEmpty()) {
380 qWarning() << "QQnxMediaPlayer: Unable to find window group";
381 return false;
382 }
383
384 static int winIdCounter = 0;
385
386 const QString windowName = QStringLiteral("QQnxVideoSink_%1_%2")
387 .arg(winIdCounter++)
389
390 m_windowGrabber->setWindowId(windowName.toLatin1());
391
392 if (m_platformVideoSink)
393 m_windowGrabber->setRhi(m_platformVideoSink->rhi());
394
395 // Start with an invisible window, because we just want to grab the frames from it.
396 const QString videoDeviceUrl = QStringLiteral("screen:?winid=%1&wingrp=%2&initflags=invisible&nodstviewport=1")
397 .arg(windowName, QString::fromLatin1(windowGroupId));
398
399 m_videoId = mmr_output_attach(m_context, videoDeviceUrl.toLatin1(), "video");
400
401 if (m_videoId == -1) {
402 qWarning() << "mmr_output_attach() for video failed";
403 return false;
404 }
405
406 return true;
407}
408
409bool QQnxMediaPlayer::attachAudioOutput()
410{
411 if (isAudioOutputAttached()) {
412 qWarning() << "QQnxMediaPlayer: Audio output already attached!";
413 return true;
414 }
415
416 const QByteArray defaultAudioDevice = qgetenv("QQNX_RENDERER_DEFAULT_AUDIO_SINK");
417
418 m_audioId = mmr_output_attach(m_context,
419 defaultAudioDevice.isEmpty() ? "snd:" : defaultAudioDevice.constData(), "audio");
420
421 if (m_audioId == -1) {
422 emitMmError("mmr_output_attach() for audio failed");
423
424 return false;
425 }
426
427 return true;
428}
429
430bool QQnxMediaPlayer::attachInput()
431{
432 if (isInputAttached())
433 return true;
434
435 const QByteArray resourcePath = resourcePathForUrl(m_media);
436
437 if (resourcePath.isEmpty())
438 return false;
439
440 if (mmr_input_attach(m_context, resourcePath.constData(), "track") != 0) {
441 emitMmError(QStringLiteral("mmr_input_attach() failed for ")
442 + QString::fromUtf8(resourcePath));
443
445
446 return false;
447 }
448
449 m_inputAttached = true;
450
451 return true;
452}
453
454void QQnxMediaPlayer::detach()
455{
456 if (!m_context)
457 return;
458
459 if (isVideoOutputAttached())
460 detachVideoOutput();
461
462 if (isAudioOutputAttached())
463 detachAudioOutput();
464
465 if (isInputAttached())
466 detachInput();
467
468 resetMonitoring();
469}
470
471void QQnxMediaPlayer::detachVideoOutput()
472{
473 m_windowGrabber->stop();
474
475 if (m_platformVideoSink)
476 m_platformVideoSink->setVideoFrame({});
477
478 if (isVideoOutputAttached())
479 mmr_output_detach(m_context, m_videoId);
480
481 m_videoId = -1;
482}
483
484void QQnxMediaPlayer::detachAudioOutput()
485{
486 if (isAudioOutputAttached())
487 mmr_output_detach(m_context, m_audioId);
488
489 m_audioId = -1;
490}
491
492void QQnxMediaPlayer::detachInput()
493{
494 if (isInputAttached())
495 mmr_input_detach(m_context);
496
497 m_inputAttached = false;
498}
499
500bool QQnxMediaPlayer::isVideoOutputAttached() const
501{
502 return m_videoId != -1;
503}
504
505bool QQnxMediaPlayer::isAudioOutputAttached() const
506{
507 return m_audioId != -1;
508}
509
510bool QQnxMediaPlayer::isInputAttached() const
511{
512 return m_inputAttached;
513}
514
515void QQnxMediaPlayer::updateScene(const QSize &size)
516{
517 if (!m_platformVideoSink)
518 return;
519
520 auto *buffer = m_windowGrabber->isEglImageSupported()
521 ? static_cast<QAbstractVideoBuffer*>(new QnxTextureBuffer(m_windowGrabber))
522 : static_cast<QAbstractVideoBuffer*>(new QnxRasterBuffer(m_windowGrabber));
523
524 const QVideoFrame actualFrame(buffer,
526
527 m_platformVideoSink->setVideoFrame(actualFrame);
528}
529
531{
532 return m_metaData.duration();
533}
534
536{
537 return m_position;
538}
539
541{
542 if (m_position == position)
543 return;
544
545 m_pendingPosition = position;
546 m_flushPositionTimer.start();
547}
548
549void QQnxMediaPlayer::setPositionInternal(qint64 position)
550{
551 if (!m_context || !m_metaData.isSeekable() || mediaStatus() == QMediaPlayer::NoMedia)
552 return;
553
554 if (mmr_seek(m_context, QString::number(position).toLatin1()) != 0)
555 emitMmError("Seeking failed");
556}
557
558void QQnxMediaPlayer::flushPosition()
559{
560 setPositionInternal(m_pendingPosition);
561}
562
563bool QQnxMediaPlayer::isPendingPositionFlush() const
564{
565 return m_flushPositionTimer.isActive();
566}
567
568void QQnxMediaPlayer::setDeferredSpeedEnabled(bool enabled)
569{
570 m_deferredSpeedEnabled = enabled;
571}
572
573bool QQnxMediaPlayer::isDeferredSpeedEnabled() const
574{
575 return m_deferredSpeedEnabled;
576}
577
578void QQnxMediaPlayer::setVolume(float volume)
579{
580 const int normalizedVolume = ::normalizeVolume(volume);
581
582 if (m_volume == normalizedVolume)
583 return;
584
585 m_volume = normalizedVolume;
586
587 if (!m_muted)
588 updateVolume();
589}
590
591void QQnxMediaPlayer::setMuted(bool muted)
592{
593 if (m_muted == muted)
594 return;
595
596 m_muted = muted;
597
598 updateVolume();
599}
600
601void QQnxMediaPlayer::updateVolume()
602{
603 if (!m_context || m_audioId == -1)
604 return;
605
606 const int volume = m_muted ? 0 : m_volume;
607
608 char buf[] = "100";
609 std::snprintf(buf, sizeof buf, "%d", volume);
610
611 strm_dict_t * dict = strm_dict_new();
612 dict = strm_dict_set(dict, "volume", buf);
613
614 if (mmr_output_parameters(m_context, m_audioId, dict) != 0)
615 emitMmError("mmr_output_parameters: Setting volume failed");
616}
617
619{
620 QAudioOutput *out = output ? output->q : nullptr;
621 if (m_audioOutput == out)
622 return;
623
624 if (m_audioOutput)
625 disconnect(m_audioOutput.get());
626 m_audioOutput = out;
627 if (m_audioOutput) {
628 connect(out, &QAudioOutput::volumeChanged, this, &QQnxMediaPlayer::setVolume);
629 connect(out, &QAudioOutput::mutedChanged, this, &QQnxMediaPlayer::setMuted);
630 }
631 setVolume(out ? out->volume() : 1.);
632 setMuted(out ? out->isMuted() : true);
633}
634
636{
637 // mm-renderer has buffer properties "status" and "level"
638 // QMediaPlayer's buffer status maps to mm-renderer's buffer level
639 return m_bufferLevel/100.0f;
640}
641
643{
644 return m_metaData.hasAudio();
645}
646
648{
649 return m_metaData.hasVideo();
650}
651
653{
654 return m_metaData.isSeekable();
655}
656
658{
659 // We can't get this information from the mmrenderer API yet, so pretend we can seek everywhere
660 return QMediaTimeRange(0, m_metaData.duration());
661}
662
664{
665 return ::speedToRate(m_speed);
666}
667
669{
670 if (!m_context)
671 return;
672
673 const int speed = ::rateToSpeed(rate);
674
675 if (m_speed == speed)
676 return;
677
678 // defer setting the playback speed for when play() is called to prevent
679 // mm-renderer from inadvertently transitioning into play state
680 if (isDeferredSpeedEnabled() && state() != QMediaPlayer::PlayingState) {
681 m_deferredSpeed = speed;
682 return;
683 }
684
685 if (mmr_speed_set(m_context, speed) != 0)
686 emitMmError("mmr_speed_set failed");
687}
688
690{
691 return m_media;
692}
693
695{
696 // Always 0, we don't support QIODevice streams
697 return 0;
698}
699
701{
702 Q_UNUSED(stream); // not supported
703
704 stop();
705 detach();
706
709
710 m_media = media;
711
712 updateMetaData(nullptr);
713 attach();
714}
715
717{
718 if (!m_media.isValid() || !m_connection || !m_context || m_audioId == -1) {
720 return;
721 }
722
724 return;
725
726 setDeferredSpeedEnabled(false);
727
728 if (m_deferredSpeed) {
729 setPlaybackRate(::speedToRate(*m_deferredSpeed));
730 m_deferredSpeed = {};
731 } else {
732 setPlaybackRate(::speedToRate(m_configuredSpeed));
733 }
734
735 setDeferredSpeedEnabled(true);
736
737 // Un-pause the state when it is paused
739 return;
740 }
741
742
744 setPositionInternal(0);
745
746 resetMonitoring();
747 updateVolume();
748
749 if (mmr_play(m_context) != 0) {
751 emitMmError("mmr_play() failed");
752 return;
753 }
754
756}
757
759{
761 return;
762
764}
765
767{
768 if (!m_context
771 return;
772
773 // mm-renderer does not rewind by default
774 setPositionInternal(0);
775
776 mmr_stop(m_context);
777}
778
780{
781 m_platformVideoSink = videoSink
782 ? static_cast<QQnxVideoSink *>(videoSink->platformVideoSink())
783 : nullptr;
784}
785
786void QQnxMediaPlayer::startMonitoring()
787{
788 m_eventThread = new QQnxMediaEventThread(m_context);
789
791 this, &QQnxMediaPlayer::readEvents);
792
793 m_eventThread->setObjectName(QStringLiteral("MmrEventThread-") + QString::number(m_id));
794 m_eventThread->start();
795}
796
797void QQnxMediaPlayer::stopMonitoring()
798{
799 delete m_eventThread;
800 m_eventThread = nullptr;
801}
802
803void QQnxMediaPlayer::resetMonitoring()
804{
805 m_bufferLevel = 0;
806 m_position = 0;
807 m_speed = 0;
808}
809
810void QQnxMediaPlayer::handleMmPositionChanged(qint64 newPosition)
811{
812 m_position = newPosition;
813
815 m_windowGrabber->forceUpdate();
816
817 positionChanged(m_position);
818}
819
820void QQnxMediaPlayer::updateBufferLevel(int level, int capacity)
821{
822 m_bufferLevel = capacity == 0 ? 0 : level / static_cast<float>(capacity) * 100.0f;
823 m_bufferLevel = qBound(0, m_bufferLevel, 100);
824 bufferProgressChanged(m_bufferLevel/100.0f);
825}
826
827void QQnxMediaPlayer::updateMetaData(const strm_dict *dict)
828{
829 m_metaData.update(dict);
830
831 durationChanged(m_metaData.duration());
832 audioAvailableChanged(m_metaData.hasAudio());
833 videoAvailableChanged(m_metaData.hasVideo());
834 seekableChanged(m_metaData.isSeekable());
835}
836
837void QQnxMediaPlayer::emitMmError(const char *msg)
838{
839 emitMmError(QString::fromUtf8(msg));
840}
841
842void QQnxMediaPlayer::emitMmError(const QString &msg)
843{
844 int errorCode = MMR_ERROR_NONE;
845 const QString errorMessage = mmErrorMessage(msg, m_context, &errorCode);
846 emit error(errorCode, errorMessage);
847}
848
849void QQnxMediaPlayer::emitPError(const QString &msg)
850{
851 const QString errorMessage = QString::fromLatin1("%1: %2").arg(msg).arg(QString::fromUtf8(strerror(errno)));
852 emit error(errno, errorMessage);
853}
854
855
856void QQnxMediaPlayer::readEvents()
857{
858 while (const mmr_event_t *event = mmr_event_get(m_context)) {
859 if (event->type == MMR_EVENT_NONE)
860 break;
861
862 switch (event->type) {
863 case MMR_EVENT_STATUS:
864 handleMmEventStatus(event);
865 break;
866 case MMR_EVENT_STATE:
867 handleMmEventState(event);
868 break;
870 updateMetaData(event->data);
871 break;
872 case MMR_EVENT_ERROR:
873 handleMmEventError(event);
874 break;
875 case MMR_EVENT_NONE:
879 case MMR_EVENT_INPUT:
880 case MMR_EVENT_OUTPUT:
882 case MMR_EVENT_TRKPAR:
883 case MMR_EVENT_OTHER:
884 break;
885 }
886 }
887
888 if (m_eventThread)
889 m_eventThread->signalRead();
890}
891
893
894#include "moc_qqnxmediaplayer_p.cpp"
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
\qmltype AudioOutput \instantiates QAudioOutput
void mutedChanged(bool muted)
void volumeChanged(float volume)
\inmodule QtCore
Definition qbytearray.h:57
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:124
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:107
static qint64 applicationPid() Q_DECL_CONST_FUNCTION
static QByteArray encodeName(const QString &fileName)
Converts fileName to an 8-bit encoding that you can use in native APIs.
Definition qfile.h:158
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QMediaPlayer class allows the playing of a media files.
The QMediaTimeRange class represents a set of zero or more disjoint time intervals.
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
Definition qobject.h:127
virtual QMediaPlayer::PlaybackState state() const
void positionChanged(qint64 position)
virtual QMediaPlayer::MediaStatus mediaStatus() const
void seekableChanged(bool seekable)
void durationChanged(qint64 duration)
void playbackRateChanged(qreal rate)
void audioAvailableChanged(bool audioAvailable)
void stateChanged(QMediaPlayer::PlaybackState newState)
void videoAvailableChanged(bool videoAvailable)
void mediaStatusChanged(QMediaPlayer::MediaStatus status)
void bufferProgressChanged(float progress)
virtual void setVideoFrame(const QVideoFrame &frame)
T * get() const noexcept
Definition qpointer.h:75
bool update(const strm_dict_t *dict)
qlonglong duration() const
void pause() override
const QIODevice * mediaStream() const override
bool isSeekable() const override
void setVideoSink(QVideoSink *videoSink)
void setAudioOutput(QPlatformAudioOutput *) override
void play() override
void setPlaybackRate(qreal rate) override
qint64 position() const override
QMediaTimeRange availablePlaybackRanges() const override
bool isAudioAvailable() const override
QQnxMediaPlayer(QMediaPlayer *parent=nullptr)
float bufferProgress() const override
void setPosition(qint64 position) override
qint64 duration() const override
void stop() override
qreal playbackRate() const override
QUrl media() const override
bool isVideoAvailable() const override
void setMedia(const QUrl &media, QIODevice *stream) override
QRhi * rhi() const
bool isEglImageSupported() const
void setWindowId(const QByteArray &windowId)
QByteArray windowGroupId() const
void updateScene(const QSize &size)
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QByteArray toLatin1() const &
Definition qstring.h:630
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5871
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:8084
void start(Priority=InheritPriority)
Definition qthread.cpp:996
void setSingleShot(bool singleShot)
Definition qtimer.cpp:552
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition qtimer.cpp:241
void setInterval(int msec)
Definition qtimer.cpp:579
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
Definition qtimer.cpp:167
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
\inmodule QtCore
Definition qurl.h:94
bool isLocalFile() const
Definition qurl.cpp:3445
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
Definition qurl.cpp:1882
QByteArray toEncoded(FormattingOptions options=FullyEncoded) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
Definition qurl.cpp:2967
QString scheme() const
Returns the scheme of the URL.
Definition qurl.cpp:1991
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
Definition qurl.cpp:3425
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
Definition qurl.cpp:2468
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:37
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QPlatformVideoSink * platformVideoSink() const
MapData map(QVideoFrame::MapMode) override
Independently maps the planes of a video buffer to memory.
QVideoFrame::MapMode mapMode() const override
QnxRasterBuffer(QQnxWindowGrabber *windowGrabber)
void unmap() override
Releases the memory mapped by the map() function.
quint64 textureHandle(QRhi *, int plane) const override
Returns a texture handle to the data buffer.
QVideoFrame::MapMode mapMode() const override
QnxTextureBuffer(QQnxWindowGrabber *QQnxWindowGrabber)
MapData map(QVideoFrame::MapMode) override
Independently maps the planes of a video buffer to memory.
void unmap() override
Releases the memory mapped by the map() function.
#define this
Definition dialogs.cpp:9
@ MMR_STATE_DESTROYED
@ MMR_STATE_PLAYING
@ MMR_STATE_STOPPED
@ MMR_STATE_IDLE
@ MMR_EVENT_STATE
@ MMR_EVENT_OVERFLOW
@ MMR_EVENT_INPUT
@ MMR_EVENT_ERROR
@ MMR_EVENT_STATUS
@ MMR_EVENT_TRKPAR
@ MMR_EVENT_PLAYLIST
@ MMR_EVENT_CTXTPAR
@ MMR_EVENT_NONE
@ MMR_EVENT_OTHER
@ MMR_EVENT_OUTPUT
@ MMR_EVENT_METADATA
@ MMR_EVENT_WARNING
const mmr_event_t * mmr_event_get(mmr_context_t *ctxt)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLStreamKHR stream
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
NSUInteger capacity
#define qCritical
Definition qlogging.h:167
#define qWarning
Definition qlogging.h:166
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition qminmax.h:44
GLenum GLuint GLint level
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint buffer
GLenum GLuint GLenum GLsizei const GLchar * buf
struct _cl_event * event
GLuint GLenum * rate
struct strm_dict strm_dict_t
static constexpr int normalizeVolume(float volume)
static std::tuple< int, int, bool > parseBufferLevel(const QString &value)
static constexpr qreal speedToRate(int speed)
static constexpr int rateToSpeed(qreal rate)
QString mmErrorMessage(const QString &msg, mmr_context_t *context, int *errorCode)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define qUtf8Printable(string)
Definition qstring.h:1535
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define emit
#define Q_UNUSED(x)
unsigned long long quint64
Definition qtypes.h:61
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
Definition qurl.cpp:3517
QT_BEGIN_NAMESPACE typedef uchar * output
#define enabled
QTextStream out(stdout)
[7]
QUrl url("example.com")
[constructor-url-reference]
myObject disconnect()
[26]