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
qmediaplayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QMEDIAPLAYER_P_H
5#define QMEDIAPLAYER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qmediaplayer.h"
19#include "qmediametadata.h"
20#include "qvideosink.h"
21#include "qaudiooutput.h"
22#include "qaudiobufferoutput.h"
23#include <private/qplatformmediaplayer_p.h>
24#include <private/qerrorinfo_p.h>
25
26#include "private/qobject_p.h"
27#include <QtCore/qobject.h>
28#include <QtCore/qpointer.h>
29#include <QtCore/qurl.h>
30#include <QtCore/qfile.h>
31#include <QtCore/qtimer.h>
32
33#include <memory>
34
36
38
40{
41 Q_DECLARE_PUBLIC(QMediaPlayer)
42
43public:
45 {
46 return reinterpret_cast<QMediaPlayerPrivate *>(QObjectPrivate::get(session));
47 }
48
51
52 QPointer<QAudioBufferOutput> audioBufferOutput;
53 QPointer<QAudioOutput> audioOutput;
54 QPointer<QVideoSink> videoSink;
55 QPointer<QObject> videoOutput;
57 std::unique_ptr<QFile> qrcFile;
59 QIODevice *stream = nullptr;
60
62 QErrorInfo<QMediaPlayer::Error> error;
63
64 void setMedia(const QUrl &media, QIODevice *stream = nullptr);
65
66 QList<QMediaMetaData> trackMetaData(QPlatformMediaPlayer::TrackType s) const;
67
70 void setError(QMediaPlayer::Error error, const QString &errorString);
71
73 {
74 Q_Q(QMediaPlayer);
75 if (sink == videoSink)
76 return;
77 if (videoSink)
78 videoSink->setSource(nullptr);
80 if (sink)
81 sink->setSource(q);
82 if (control)
84 emit q->videoOutputChanged();
85 }
86};
87
89
90#endif
\inmodule QtCore \reentrant
Definition qiodevice.h:34
QPlatformMediaPlayer * control
void setState(QMediaPlayer::PlaybackState state)
\qmltype MediaPlayer \instantiates QMediaPlayer
QMediaPlayer::PlaybackState state
QList< QMediaMetaData > trackMetaData(QPlatformMediaPlayer::TrackType s) const
void setMedia(const QUrl &media, QIODevice *stream=nullptr)
QPointer< QObject > videoOutput
QErrorInfo< QMediaPlayer::Error > error
void setVideoSink(QVideoSink *sink)
std::unique_ptr< QFile > qrcFile
QPointer< QVideoSink > videoSink
QPointer< QAudioOutput > audioOutput
void setStatus(QMediaPlayer::MediaStatus status)
void setError(QMediaPlayer::Error error, const QString &errorString)
QMediaPlayerPrivate()=default
static QMediaPlayerPrivate * get(QMediaPlayer *session)
QPointer< QAudioBufferOutput > audioBufferOutput
The QMediaPlayer class allows the playing of a media files.
MediaStatus
\qmlproperty enumeration QtMultimedia::MediaPlayer::playbackState
PlaybackState
Defines the current state of a media player.
Error
\qmlproperty enumeration QtMultimedia::MediaPlayer::mediaStatus
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:150
virtual void setVideoSink(QVideoSink *)=0
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
Combined button and popup list for selecting options.
EGLStreamKHR stream
GLdouble s
[6]
Definition qopenglext.h:235
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei GLenum GLboolean sink
#define emit