17 #include "urihandler.h"
19 #include <gst/gsturi.h>
20 #include <QtCore/QUrl>
21 #include <QtCore/QStringList>
26 bool UriHandler::protocolIsSupported(UriType type,
const char *protocol)
28 return gst_uri_protocol_is_supported(static_cast<GstURIType>(type), protocol);
32 ElementPtr UriHandler::makeFromUri(UriType type,
const QUrl & uri,
const char *elementName)
34 GstElement *e = gst_element_make_from_uri(static_cast<GstURIType>(type), uri.toEncoded(), elementName);
36 gst_object_ref_sink(e);
41 UriType UriHandler::uriType()
const
43 return static_cast<UriType
>(gst_uri_handler_get_uri_type(object<GstURIHandler>()));
46 QStringList UriHandler::supportedProtocols()
const
49 char **protocols = gst_uri_handler_get_protocols(object<GstURIHandler>());
51 for (
char **p = protocols; p && *p; ++p) {
52 result.append(QString::fromUtf8(*p));
58 QUrl UriHandler::uri()
const
62 return QUrl::fromPercentEncoding(gst_uri_handler_get_uri(object<GstURIHandler>()));
65 bool UriHandler::setUri(
const QUrl & uri)
67 return gst_uri_handler_set_uri(object<GstURIHandler>(), uri.toEncoded());