17 #include "urihandler.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)
35 GstElement *e = gst_element_make_from_uri(
static_cast<GstURIType
>(type), uri.toEncoded(), elementName, &error);
40 gst_object_ref_sink(e);
45 UriType UriHandler::uriType()
const
47 return static_cast<UriType
>(gst_uri_handler_get_uri_type(object<GstURIHandler>()));
50 QStringList UriHandler::supportedProtocols()
const
53 const char *
const *protocols = gst_uri_handler_get_protocols(object<GstURIHandler>());
55 for (
const char *
const *p = protocols; p && *p; ++p) {
56 result.append(QString::fromUtf8(*p));
62 QUrl UriHandler::uri()
const
66 return QUrl::fromPercentEncoding(gst_uri_handler_get_uri(object<GstURIHandler>()));
69 bool UriHandler::setUri(
const QUrl & uri)
73 result = gst_uri_handler_set_uri(object<GstURIHandler>(), uri.toEncoded(), &error);
Wrapper class for GError.
static RefPointer< Element > wrap(typename T::CType *nativePtr, bool increaseRef=true)
Wrappers for GStreamer classes.