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
qglist_helper_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QGLIST_HELPER_P_H
5#define QGLIST_HELPER_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 <QtCore/qtconfigmacros.h>
19
20#include <QtMultimedia/private/qiteratorfacade_p.h>
21
22#include <glib.h>
23#include <iterator>
24#include <type_traits>
25
26QT_BEGIN_NAMESPACE
27
28namespace QGstUtils {
29
30template <typename ListType, bool IsConst>
34{
36
37 explicit GListIterator(GListType element = nullptr) : element(element) { }
38
39 const ListType &dereference() const noexcept
40 {
41 return *reinterpret_cast<const ListType *>(&element->data);
42 }
43
44 void increment() noexcept
45 {
46 if (element)
47 element = element->next;
48 }
49
50 bool equals(const GListIterator &other) const noexcept { return element == other.element; }
51
52 GListType element = nullptr;
53};
54
55template <typename ListType, bool IsConst>
57{
58 static_assert(std::is_pointer_v<ListType>);
59
61
62 explicit GListRangeAdaptorImpl(GListType list) : head(list) { }
63
64 auto begin() { return GListIterator<ListType, IsConst>(head); }
65 auto end() { return GListIterator<ListType, IsConst>(nullptr); }
66
68};
69
70template <typename ListType>
72template <typename ListType>
74
75} // namespace QGstUtils
76
77QT_END_NAMESPACE
78
79#endif
q23::expected< QGstDiscovererInfo, QUniqueGErrorHandle > discover(const QString &uri)
q23::expected< QGstDiscovererInfo, QUniqueGErrorHandle > discover(QIODevice *)
GListRangeAdaptorImpl< ListType, true > GListConstRangeAdaptor
GListRangeAdaptorImpl< ListType, false > GListRangeAdaptor
QMediaMetaData toStreamMetadata(const QGstDiscovererAudioInfo &info)
static constexpr std::chrono::nanoseconds discovererTimeout
QMediaMetaData toStreamMetadata(const QGstDiscovererSubtitleInfo &info)
QMediaMetaData toStreamMetadata(const QGstDiscovererVideoInfo &info)
QMediaMetaData toContainerMetadata(const QGstDiscovererInfo &info)
static void updateMetadata(QMediaMetaData &metadata, QMediaMetaData::Key key, ValueType value)
void addMissingKeysFromTaglist(QMediaMetaData &metadata, const QGstTagListHandle &tagList)
Combined button and popup list for selecting options.
GListIterator(GListType element=nullptr)
const ListType & dereference() const noexcept
bool equals(const GListIterator &other) const noexcept
std::vector< QGstDiscovererAudioInfo > audioStreams
std::vector< QGstDiscovererContainerInfo > containerStreams
std::vector< QGstDiscovererVideoInfo > videoStreams
std::optional< QGstDiscovererContainerInfo > containerInfo
std::vector< QGstDiscovererSubtitleInfo > subtitleStreams
std::optional< std::chrono::nanoseconds > duration