Tidy up http gstreamer source element.
This commit is contained in:
parent
747ae61620
commit
4862c41477
@ -20,6 +20,13 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
const char* GstEnginePipeline::kHttpGstreamerSource =
|
||||||
|
#ifdef Q_OS_DARWIN
|
||||||
|
"neonhttpsrc";
|
||||||
|
#else
|
||||||
|
"souphttpsrc"; // Does not exist on mac/fink.
|
||||||
|
#endif
|
||||||
|
|
||||||
GstEnginePipeline::GstEnginePipeline()
|
GstEnginePipeline::GstEnginePipeline()
|
||||||
: QObject(NULL),
|
: QObject(NULL),
|
||||||
valid_(false),
|
valid_(false),
|
||||||
@ -59,20 +66,11 @@ bool GstEnginePipeline::Init(const QUrl &url) {
|
|||||||
// audiosink
|
// audiosink
|
||||||
|
|
||||||
// Source
|
// Source
|
||||||
#ifdef Q_OS_DARWIN
|
|
||||||
// giosrc from Fink does not support HTTP.
|
|
||||||
if (url.scheme() == "http") {
|
if (url.scheme() == "http") {
|
||||||
src_ = GstEngine::CreateElement("neonhttpsrc");
|
src_ = GstEngine::CreateElement(kHttpGstreamerSource);
|
||||||
} else {
|
} else {
|
||||||
src_ = GstEngine::CreateElement("giosrc");
|
src_ = GstEngine::CreateElement("giosrc");
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (url.scheme() == "http") {
|
|
||||||
src_ = GstEngine::CreateElement("souphttpsrc");
|
|
||||||
} else {
|
|
||||||
src_ = GstEngine::CreateElement("giosrc");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!src_)
|
if (!src_)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -81,6 +81,8 @@ class GstEnginePipeline : public QObject {
|
|||||||
private:
|
private:
|
||||||
static const int kGstStateTimeoutNanosecs = 10000000;
|
static const int kGstStateTimeoutNanosecs = 10000000;
|
||||||
|
|
||||||
|
static const char* kHttpGstreamerSource;
|
||||||
|
|
||||||
bool valid_;
|
bool valid_;
|
||||||
QString sink_;
|
QString sink_;
|
||||||
QString device_;
|
QString device_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user