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
androidmediaplayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 ANDROIDMEDIAPLAYER_H
5#define ANDROIDMEDIAPLAYER_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 <QObject>
19#include <QNetworkRequest>
20#include <QtCore/qjniobject.h>
21#include <QAudio>
22
24
26
28{
30public:
33
48
60
62 Uninitialized = 0x1, /* End */
63 Idle = 0x2,
64 Preparing = 0x4,
65 Prepared = 0x8,
67 Started = 0x20,
68 Stopped = 0x40,
69 Paused = 0x80,
71 Error = 0x200
72 };
73
75
83
84 void release();
85 void reset();
86
88 int getDuration();
89 bool isPlaying();
90 int volume();
91 bool isMuted();
94
95 void play();
96 void pause();
97 void stop();
98 void seekTo(qint32 msec);
99 void setMuted(bool mute);
100 void setDataSource(const QNetworkRequest &request);
101 void prepareAsync();
102 void setVolume(int volume);
103 static void startSoundStreaming(const int inputId, const int outputId);
104 static void stopSoundStreaming();
105 bool setPlaybackRate(qreal rate);
106 void setDisplay(AndroidSurfaceTexture *surfaceTexture);
107 static bool setAudioOutput(const QByteArray &deviceId);
109 int activeTrack(TrackType trackType);
110 void deselectTrack(int trackNumber);
111 void selectTrack(int trackNumber);
112
113 static bool registerNativeMethods();
114
115 void blockAudio();
116 void unblockAudio();
119 void bufferingChanged(qint32 percent);
120 void durationChanged(qint64 duration);
121 void progressChanged(qint64 progress);
122 void stateChanged(qint32 state);
123 void info(qint32 what, qint32 extra);
124 void videoSizeChanged(qint32 width, qint32 height);
125 void timedTextChanged(QString text);
127
128private:
129 QJniObject mMediaPlayer;
130 bool mAudioBlocked = false;
131};
132
133QT_END_NAMESPACE
134
135#endif // ANDROIDMEDIAPLAYER_H
void progressChanged(qint64 progress)
void seekTo(qint32 msec)
void deselectTrack(int trackNumber)
static bool registerNativeMethods()
void stateChanged(qint32 state)
void selectTrack(int trackNumber)
QList< TrackInfo > tracksInfo()
void setDataSource(const QNetworkRequest &request)
static void stopSoundStreaming()
void videoSizeChanged(qint32 width, qint32 height)
void setDisplay(AndroidSurfaceTexture *surfaceTexture)
void bufferingChanged(qint32 percent)
void durationChanged(qint64 duration)
void timedTextChanged(QString text)
void info(qint32 what, qint32 extra)
static bool setAudioOutput(const QByteArray &deviceId)
bool setPlaybackRate(qreal rate)
int activeTrack(TrackType trackType)
static void startSoundStreaming(const int inputId, const int outputId)
void setVolume(int volume)
void stateChanged(QMediaRecorder::RecorderState state)
QList< QSize > supportedResolutions() const
QMediaEncoderSettings encoderSettings()
void start(QMediaEncoderSettings &settings, const QUrl &outputLocation)
void actualLocationChanged(const QUrl &location)
void setAudioInput(QPlatformAudioInput *input)
void setAudioOutput(QPlatformAudioOutput *output)
void durationChanged(qint64 position)
QList< qreal > supportedFrameRates() const
void updateError(int error, const QString &errorString)
void setMediaEncoder(QAndroidMediaEncoder *encoder)
void setCameraSession(QAndroidCameraSession *cameraSession=0)
void record(QMediaEncoderSettings &settings) override
qint64 duration() const override
QAndroidMediaEncoder(QMediaRecorder *parent)
void setCaptureSession(QPlatformMediaCaptureSession *session)