![]() |
Qt 6.x
The Qt SDK
|
#include <androidmediaplayer_p.h>
Classes | |
struct | TrackInfo |
Public Types | |
enum | MediaError { MEDIA_ERROR_UNKNOWN = 1 , MEDIA_ERROR_SERVER_DIED = 100 , MEDIA_ERROR_INVALID_STATE = -38 , MEDIA_ERROR_IO = -1004 , MEDIA_ERROR_MALFORMED = -1007 , MEDIA_ERROR_UNSUPPORTED = -1010 , MEDIA_ERROR_TIMED_OUT = -110 , MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200 , MEDIA_ERROR_BAD_THINGS_ARE_GOING_TO_HAPPEN = -2147483648 } |
enum | MediaInfo { MEDIA_INFO_UNKNOWN = 1 , MEDIA_INFO_VIDEO_TRACK_LAGGING = 700 , MEDIA_INFO_VIDEO_RENDERING_START = 3 , MEDIA_INFO_BUFFERING_START = 701 , MEDIA_INFO_BUFFERING_END = 702 , MEDIA_INFO_BAD_INTERLEAVING = 800 , MEDIA_INFO_NOT_SEEKABLE = 801 , MEDIA_INFO_METADATA_UPDATE = 802 } |
enum | MediaPlayerState { Uninitialized = 0x1 , Idle = 0x2 , Preparing = 0x4 , Prepared = 0x8 , Initialized = 0x10 , Started = 0x20 , Stopped = 0x40 , Paused = 0x80 , PlaybackCompleted = 0x100 , Error = 0x200 } |
enum | TrackType { Unknown = 0 , Video , Audio , TimedText , Subtitle , Metadata } |
Signals | |
void | error (qint32 what, qint32 extra) |
void | bufferingChanged (qint32 percent) |
void | durationChanged (qint64 duration) |
void | progressChanged (qint64 progress) |
void | stateChanged (qint32 state) |
void | info (qint32 what, qint32 extra) |
void | videoSizeChanged (qint32 width, qint32 height) |
void | timedTextChanged (QString text) |
void | tracksInfoChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
AndroidMediaPlayer () | |
~AndroidMediaPlayer () | |
void | release () |
void | reset () |
int | getCurrentPosition () |
int | getDuration () |
bool | isPlaying () |
int | volume () |
bool | isMuted () |
qreal | playbackRate () |
jobject | display () |
void | play () |
void | pause () |
void | stop () |
void | seekTo (qint32 msec) |
void | setMuted (bool mute) |
void | setDataSource (const QNetworkRequest &request) |
void | prepareAsync () |
void | setVolume (int volume) |
bool | setPlaybackRate (qreal rate) |
void | setDisplay (AndroidSurfaceTexture *surfaceTexture) |
QList< TrackInfo > | tracksInfo () |
int | activeTrack (TrackType trackType) |
void | deselectTrack (int trackNumber) |
void | selectTrack (int trackNumber) |
void | blockAudio () |
void | unblockAudio () |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Static Public Member Functions | |
static void | startSoundStreaming (const int inputId, const int outputId) |
static void | stopSoundStreaming () |
static bool | setAudioOutput (const QByteArray &deviceId) |
static bool | registerNativeMethods () |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
QString | objectName |
the name of this object | |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 27 of file androidmediaplayer_p.h.
Definition at line 34 of file androidmediaplayer_p.h.
Definition at line 49 of file androidmediaplayer_p.h.
Enumerator | |
---|---|
Uninitialized | |
Idle | |
Preparing | |
Prepared | |
Initialized | |
Started | |
Stopped | |
Paused | |
PlaybackCompleted | |
Error |
Definition at line 61 of file androidmediaplayer_p.h.
Enumerator | |
---|---|
Unknown | |
Video | |
Audio | |
TimedText | |
Subtitle | |
Metadata |
Definition at line 74 of file androidmediaplayer_p.h.
AndroidMediaPlayer::AndroidMediaPlayer | ( | ) |
AndroidMediaPlayer::~AndroidMediaPlayer | ( | ) |
Definition at line 35 of file androidmediaplayer.cpp.
int AndroidMediaPlayer::activeTrack | ( | TrackType | trackType | ) |
Definition at line 173 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::activeTrack().
void AndroidMediaPlayer::blockAudio | ( | ) |
Definition at line 245 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
void AndroidMediaPlayer::deselectTrack | ( | int | trackNumber | ) |
Definition at line 179 of file androidmediaplayer.cpp.
jobject AndroidMediaPlayer::display | ( | ) |
Definition at line 102 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setMedia().
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
int AndroidMediaPlayer::getCurrentPosition | ( | ) |
Definition at line 53 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::pause(), QAndroidMediaPlayer::position(), and QAndroidMediaPlayer::setPosition().
int AndroidMediaPlayer::getDuration | ( | ) |
Definition at line 58 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::duration().
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
bool AndroidMediaPlayer::isMuted | ( | ) |
Definition at line 73 of file androidmediaplayer.cpp.
bool AndroidMediaPlayer::isPlaying | ( | ) |
Definition at line 63 of file androidmediaplayer.cpp.
void AndroidMediaPlayer::pause | ( | ) |
Definition at line 194 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::pause().
void AndroidMediaPlayer::play | ( | ) |
Definition at line 189 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::play().
qreal AndroidMediaPlayer::playbackRate | ( | ) |
Definition at line 78 of file androidmediaplayer.cpp.
References player.
Referenced by QAndroidMediaPlayer::play().
void AndroidMediaPlayer::prepareAsync | ( | ) |
Definition at line 232 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setMedia().
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
|
static |
Definition at line 513 of file androidmediaplayer.cpp.
References methods, onBufferingUpdateNative(), onDurationChangedNative(), onErrorNative(), onInfoNative(), onProgressUpdateNative(), onStateChangedNative(), onTimedTextChangedNative(), onTrackInfoChangedNative(), onVideoSizeChangedNative(), and QtAndroidMediaPlayerClassName.
Referenced by JNI_OnLoad().
void AndroidMediaPlayer::release | ( | ) |
Definition at line 43 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::~QAndroidMediaPlayer().
void AndroidMediaPlayer::reset | ( | ) |
Definition at line 48 of file androidmediaplayer.cpp.
Definition at line 204 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setPosition().
void AndroidMediaPlayer::selectTrack | ( | int | trackNumber | ) |
Definition at line 184 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setActiveTrack().
|
static |
Definition at line 287 of file androidmediaplayer.cpp.
References qCWarning, ret, and QByteArray::toInt().
Referenced by QAndroidCaptureSession::setAudioOutput(), and QAndroidMediaPlayer::updateAudioDevice().
void AndroidMediaPlayer::setDataSource | ( | const QNetworkRequest & | request | ) |
Definition at line 217 of file androidmediaplayer.cpp.
References QUrl::FullyEncoded, header(), QNetworkRequest::rawHeader(), QNetworkRequest::rawHeaderList(), request, QUrl::toString(), and QNetworkRequest::url().
Referenced by QAndroidMediaPlayer::setMedia().
void AndroidMediaPlayer::setDisplay | ( | AndroidSurfaceTexture * | surfaceTexture | ) |
Definition at line 280 of file androidmediaplayer.cpp.
References AndroidSurfaceTexture::surfaceHolder().
Referenced by QAndroidMediaPlayer::setActiveTrack(), QAndroidMediaPlayer::setMedia(), and QAndroidMediaPlayer::setVideoSink().
void AndroidMediaPlayer::setMuted | ( | bool | mute | ) |
Definition at line 209 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setActiveTrack().
bool AndroidMediaPlayer::setPlaybackRate | ( | qreal | rate | ) |
Definition at line 269 of file androidmediaplayer.cpp.
References qWarning.
Referenced by QAndroidMediaPlayer::play(), and QAndroidMediaPlayer::setPlaybackRate().
void AndroidMediaPlayer::setVolume | ( | int | volume | ) |
Definition at line 237 of file androidmediaplayer.cpp.
References volume().
|
static |
Definition at line 255 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
void AndroidMediaPlayer::stop | ( | ) |
Definition at line 199 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::stop().
|
static |
Definition at line 263 of file androidmediaplayer.cpp.
Referenced by QAndroidCaptureSession::~QAndroidCaptureSession().
QList< AndroidMediaPlayer::TrackInfo > AndroidMediaPlayer::tracksInfo | ( | ) |
Definition at line 139 of file androidmediaplayer.cpp.
References convertTrackInfo(), and QList< T >::insert().
|
signal |
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
void AndroidMediaPlayer::unblockAudio | ( | ) |
Definition at line 250 of file androidmediaplayer.cpp.
Referenced by QAndroidMediaPlayer::setActiveTrack().
Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer().
int AndroidMediaPlayer::volume | ( | ) |
Definition at line 68 of file androidmediaplayer.cpp.
Referenced by setVolume().