Qt 6.x
The Qt SDK
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
24#include "private/qobject_p.h"
25#include <QtCore/qobject.h>
26#include <QtCore/qpointer.h>
27#include <QtCore/qurl.h>
28#include <QtCore/qfile.h>
29#include <QtCore/qtimer.h>
30
31#include <memory>
32
34
36
38{
39 Q_DECLARE_PUBLIC(QMediaPlayer)
40
41public:
45
50 std::unique_ptr<QFile> qrcFile;
52 QIODevice *stream = nullptr;
53
56
57 void setMedia(const QUrl &media, QIODevice *stream = nullptr);
58
60
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
\qmltype AudioOutput \instantiates QAudioOutput
\inmodule QtCore \reentrant
Definition qiodevice.h:34
Definition qlist.h:74
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
void setVideoSink(QVideoSink *sink)
std::unique_ptr< QFile > qrcFile
QAudioOutput * audioOutput
void setStatus(QMediaPlayer::MediaStatus status)
QMediaPlayer::Error error
void setError(QMediaPlayer::Error error, const QString &errorString)
QVideoSink * videoSink
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
\inmodule QtCore
Definition qpointer.h:18
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\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 GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei GLenum GLboolean sink
GLdouble s
[6]
Definition qopenglext.h:235
#define emit