Add headers to MediaPlaybackRequest.
Add a name/value map for headers to MediaPlaybackRequest. When adding a new gst source that accepts extra-headers (souphttpsrc), add these headers.
This commit is contained in:
parent
9ed5503ee3
commit
3c7b509d59
|
@ -1034,6 +1034,23 @@ void GstEnginePipeline::SourceSetupCallback(GstURIDecodeBin* bin,
|
|||
g_object_set(element, "ssl-strict", TRUE, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(element),
|
||||
"extra-headers")) {
|
||||
if (!instance->current_.headers_.empty()) {
|
||||
GstStructure* gheaders = gst_structure_new_empty("headers");
|
||||
QMapIterator<QByteArray, QByteArray> i(instance->current_.headers_);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
qLog(Debug) << "Adding header" << i.key();
|
||||
gst_structure_set(gheaders, i.key().constData(), G_TYPE_STRING,
|
||||
i.value().constData(), nullptr);
|
||||
}
|
||||
g_object_set(element, "extra-headers", gheaders, nullptr);
|
||||
gst_structure_free(gheaders);
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref(element);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#ifndef ENGINES_PLAYBACKREQUEST_H_
|
||||
#define ENGINES_PLAYBACKREQUEST_H_
|
||||
|
||||
#include <QMap>
|
||||
#include <QUrl>
|
||||
|
||||
class MediaPlaybackRequest {
|
||||
|
@ -26,6 +27,9 @@ class MediaPlaybackRequest {
|
|||
MediaPlaybackRequest() {}
|
||||
|
||||
QUrl url_;
|
||||
|
||||
typedef QMap<QByteArray, QByteArray> HeaderList;
|
||||
HeaderList headers_;
|
||||
};
|
||||
|
||||
#endif // ENGINES_PLAYBACKREQUEST_H_
|
||||
|
|
Loading…
Reference in New Issue