From 3141c4b25acdca0779eec5fad6465a944ccc864e Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Mon, 17 Jan 2011 17:12:38 +0200 Subject: Add format/setFormat methods on ApplicationSource. --- src/QGst/Utils/applicationsource.cpp | 13 +++++++++++++ src/QGst/Utils/applicationsource.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/QGst/Utils/applicationsource.cpp b/src/QGst/Utils/applicationsource.cpp index 51fead2..6c3e9e4 100644 --- a/src/QGst/Utils/applicationsource.cpp +++ b/src/QGst/Utils/applicationsource.cpp @@ -227,6 +227,19 @@ void ApplicationSource::setMinPercent(uint min) } } +Format ApplicationSource::format() const +{ + return d->m_appsrc ? d->m_appsrc->property("format").get() : FormatBytes; +} + +void ApplicationSource::setFormat(Format f) +{ + d->lazyConstruct(this); + if (d->m_appsrc) { + d->m_appsrc->setProperty("format", f); + } +} + FlowReturn ApplicationSource::pushBuffer(const BufferPtr & buffer) { if (d->appSrc()) { diff --git a/src/QGst/Utils/applicationsource.h b/src/QGst/Utils/applicationsource.h index 6e53c1a..5cd1706 100644 --- a/src/QGst/Utils/applicationsource.h +++ b/src/QGst/Utils/applicationsource.h @@ -171,6 +171,10 @@ public: void setMinPercent(uint min); + Format format() const; + void setFormat(Format f); + + /*! Adds a buffer to the queue of buffers that the appsrc element will * push to its source pad. When the block property is TRUE, this function * can block until free space becomes available in the queue. -- cgit v1.2.3