summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-17 17:12:38 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-17 17:12:38 +0200
commit3141c4b25acdca0779eec5fad6465a944ccc864e (patch)
treec3c652c2784419a784ddacbcbd65084f8592cab5
parent0207a81b855f71c99d0671970e978c43f3eb96e0 (diff)
Add format/setFormat methods on ApplicationSource.
-rw-r--r--src/QGst/Utils/applicationsource.cpp13
-rw-r--r--src/QGst/Utils/applicationsource.h4
2 files changed, 17 insertions, 0 deletions
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<Format>() : 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.