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 <private/qplatformmediaplayer_p.h>
23#include <private/qerrorinfo_p.h>
24
25#include "private/qobject_p.h"
26#include <QtCore/qobject.h>
27#include <QtCore/qpointer.h>
28#include <QtCore/qurl.h>
29#include <QtCore/qfile.h>
30#include <QtCore/qtimer.h>
31
32#include <memory>
33
35
37
39{
40 Q_DECLARE_PUBLIC(QMediaPlayer)
41
42public:
45
46 QPointer<QAudioOutput> audioOutput;
47 QPointer<QVideoSink> videoSink;
48 QPointer<QObject> videoOutput;
50 std::unique_ptr<QFile> qrcFile;
52 QIODevice *stream = nullptr;
53
55 QErrorInfo<QMediaPlayer::Error> error;
56
57 void setMedia(const QUrl &media, QIODevice *stream = nullptr);
58
59 QList<QMediaMetaData> trackMetaData(QPlatformMediaPlayer::TrackType s) const;
60
63 void setError(QMediaPlayer::Error error, const QString &errorString);
64
66 {
67 Q_Q(QMediaPlayer);
68 if (sink == videoSink)
69 return;
70 if (videoSink)
71 videoSink->setSource(nullptr);
73 if (sink)
74 sink->setSource(q);
75 if (control)
77 emit q->videoOutputChanged();
78 }
79};
80
82
83#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
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
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