14 if (!
name || strncmp(
name,
"audio/", 6))
17 if (!strcmp(
name,
"mpeg")) {
18 auto version = structure[
"mpegversion"].toInt();
20 auto layer = structure[
"layer"];
26 }
else if (!strcmp(
name,
"x-ac3")) {
28 }
else if (!strcmp(
name,
"x-eac3")) {
30 }
else if (!strcmp(
name,
"x-flac")) {
32 }
else if (!strcmp(
name,
"x-alac")) {
34 }
else if (!strcmp(
name,
"x-true-hd")) {
36 }
else if (!strcmp(
name,
"x-vorbis")) {
38 }
else if (!strcmp(
name,
"x-opus")) {
40 }
else if (!strcmp(
name,
"x-wav")) {
42 }
else if (!strcmp(
name,
"x-wma")) {
52 if (!
name || strncmp(
name,
"video/", 6))
56 if (!strcmp(
name,
"mpeg")) {
57 auto version = structure[
"mpegversion"].toInt();
60 else if (version == 2)
62 else if (version == 4)
64 }
else if (!strcmp(
name,
"x-h264")) {
66#if GST_CHECK_VERSION(1, 17, 0)
67 }
else if (!strcmp(
name,
"x-h265")) {
70 }
else if (!strcmp(
name,
"x-vp8")) {
72 }
else if (!strcmp(
name,
"x-vp9")) {
74 }
else if (!strcmp(
name,
"x-av1")) {
76 }
else if (!strcmp(
name,
"x-theora")) {
78 }
else if (!strcmp(
name,
"x-jpeg")) {
80 }
else if (!strcmp(
name,
"x-wmv")) {
90 if (!strcmp(
name,
"video/x-ms-asf")) {
92 }
else if (!strcmp(
name,
"video/x-msvideo")) {
94 }
else if (!strcmp(
name,
"video/x-matroska")) {
96 }
else if (!strcmp(
name,
"video/quicktime")) {
100 else if (!strcmp(
variant,
"iso"))
102 }
else if (!strcmp(
name,
"video/ogg")) {
104 }
else if (!strcmp(
name,
"video/webm")) {
106 }
else if (!strcmp(
name,
"audio/x-m4a")) {
108 }
else if (!strcmp(
name,
"audio/x-wav")) {
110 }
else if (!strcmp(
name,
"audio/mpeg")) {
111 auto mpegversion = structure[
"mpegversion"].toInt();
112 if (mpegversion == 1) {
113 auto layer = structure[
"layer"];
126 if (!strcmp(
name,
"image/jpeg")) {
128 }
else if (!strcmp(
name,
"image/png")) {
130 }
else if (!strcmp(
name,
"image/webp")) {
132 }
else if (!strcmp(
name,
"image/tiff")) {
143 GstPadDirection padDirection =
decode ? GST_PAD_SINK : GST_PAD_SRC;
145 GList *elementList = gst_element_factory_list_get_elements(
decode ? GST_ELEMENT_FACTORY_TYPE_DECODER : GST_ELEMENT_FACTORY_TYPE_ENCODER,
148 GList *element = elementList;
150 GstElementFactory *
factory = (GstElementFactory *)element->data;
151 element = element->next;
153 const GList *padTemplates = gst_element_factory_get_static_pad_templates(
factory);
154 while (padTemplates) {
155 GstStaticPadTemplate *padTemplate = (GstStaticPadTemplate *)padTemplates->data;
156 padTemplates = padTemplates->next;
158 if (padTemplate->direction == padDirection) {
161 for (
int i = 0;
i < caps.size();
i++) {
173 gst_plugin_feature_list_free(elementList);
174 return {audio, video};
184 GstPadDirection padDirection = demuxer ? GST_PAD_SINK : GST_PAD_SRC;
186 GList *elementList = gst_element_factory_list_get_elements(demuxer ? GST_ELEMENT_FACTORY_TYPE_DEMUXER : GST_ELEMENT_FACTORY_TYPE_MUXER,
188 GList *element = elementList;
190 GstElementFactory *
factory = (GstElementFactory *)element->data;
191 element = element->next;
195 const GList *padTemplates = gst_element_factory_get_static_pad_templates(
factory);
196 while (padTemplates) {
197 GstStaticPadTemplate *padTemplate = (GstStaticPadTemplate *)padTemplates->data;
198 padTemplates = padTemplates->next;
200 if (padTemplate->direction == padDirection) {
203 for (
int i = 0;
i < caps.size();
i++) {
217 padTemplates = gst_element_factory_get_static_pad_templates(
factory);
218 while (padTemplates) {
219 GstStaticPadTemplate *padTemplate = (GstStaticPadTemplate *)padTemplates->data;
220 padTemplates = padTemplates->next;
223 if (padTemplate->direction != padDirection) {
226 bool acceptsRawAudio =
false;
227 for (
int i = 0;
i < caps.size();
i++) {
229 if (structure.
name() ==
"audio/x-raw")
230 acceptsRawAudio =
true;
233 audioCodecs.
append(audio);
236 videoCodecs.
append(video);
238 if (acceptsRawAudio && fileFormats.
size() == 1) {
239 switch (fileFormats.
at(0)) {
257 for (
auto f : std::as_const(fileFormats)) {
258 muxers.
append({
f, audioCodecs, videoCodecs});
269 gst_plugin_feature_list_free(elementList);
277 GList *elementList = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_ENCODER,
280 GList *element = elementList;
282 GstElementFactory *
factory = (GstElementFactory *)element->data;
283 element = element->next;
285 const GList *padTemplates = gst_element_factory_get_static_pad_templates(
factory);
286 while (padTemplates) {
287 GstStaticPadTemplate *padTemplate = (GstStaticPadTemplate *)padTemplates->data;
288 padTemplates = padTemplates->next;
290 if (padTemplate->direction == GST_PAD_SRC) {
293 for (
int i = 0;
i < caps.
size();
i++) {
304 gst_plugin_feature_list_free(elementList);
311 qDebug() <<
"Audio codecs:";
312 for (
const auto &
c : codecList)
318 qDebug() <<
"Video codecs:";
319 for (
const auto &
c : codecList)
325 for (
const auto &
m : muxerList) {
328 for (
const auto &
a :
m.audio)
331 for (
const auto &
v :
m.video)
363 "video/quicktime, variant=(string)iso",
367 "video/quicktime, variant=(string)iso",
368 "video/quicktime, variant=(string)iso",
370 "audio/mpeg, mpegversion=(int)1, layer=(int)3",
379 auto codec =
f.audioCodec();
384 "audio/mpeg, mpegversion=(int)1, layer=(int)3",
385 "audio/mpeg, mpegversion=(int)4",
401 auto codec =
f.videoCodec();
406 "video/mpeg, mpegversion=(int)1",
407 "video/mpeg, mpegversion=(int)2",
408 "video/mpeg, mpegversion=(int)4",
constexpr const_pointer data() const noexcept
QGstStructure at(int index) const
QByteArrayView name() const
QByteArray toString() const
FileFormat
Choose one of the following image formats:
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum format
QVideoFrameFormat::PixelFormat fmt
QItemEditorFactory * factory
bool contains(const AT &t) const noexcept