Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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"
24#include <private/qplatformmediaplayer_p.h>
25#include <private/qerrorinfo_p.h>
26
27#include "private/qobject_p.h"
28#include <QtCore/qobject.h>
29#include <QtCore/qpointer.h>
30#include <QtCore/qurl.h>
31#include <QtCore/qfile.h>
32#include <QtCore/qtimer.h>
33
34#include <memory>
35
36QT_BEGIN_NAMESPACE
37
38class QPlatformMediaPlayer;
39
41{
42 Q_DECLARE_PUBLIC(QMediaPlayer)
43
44public:
46 {
47 return reinterpret_cast<QMediaPlayerPrivate *>(QObjectPrivate::get(session));
48 }
49
51 QPlatformMediaPlayer *control = nullptr;
52
60 QIODevice *stream = nullptr;
62
65
66 void setMedia(const QUrl &media, QIODevice *stream = nullptr);
67
68 QList<QMediaMetaData> trackMetaData(QPlatformMediaPlayer::TrackType s) const;
69
70 void setState(QMediaPlayer::PlaybackState state);
71 void setStatus(QMediaPlayer::MediaStatus status);
72 void setError(QMediaPlayer::Error error, const QString &errorString);
73
74 void setVideoSink(QVideoSink *sink)
75 {
76 Q_Q(QMediaPlayer);
77 if (sink == videoSink)
78 return;
79 if (videoSink)
80 videoSink->setSource(nullptr);
81 videoSink = sink;
82 if (sink)
83 sink->setSource(q);
84 if (control)
85 control->setVideoSink(sink);
86 emit q->videoOutputChanged();
87 }
88};
89
90QT_END_NAMESPACE
91
92#endif
QPlatformMediaPlayer * control
void setState(QMediaPlayer::PlaybackState state)
\qmltype MediaPlayer \nativetype QMediaPlayer
QList< QMediaMetaData > trackMetaData(QPlatformMediaPlayer::TrackType s) const
QPlaybackOptions playbackOptions
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)
QPointer< QAudioBufferOutput > audioBufferOutput
The QPlaybackOptions class enables low-level control of media playback options.