[gstreamermm] Gst::Context: minors
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gstreamermm] Gst::Context: minors
- Date: Fri, 28 Aug 2015 11:14:13 +0000 (UTC)
commit cfe692a5578f8861910895e2022cbfd5c95ac761
Author: Marcin Kolny <marcin kolny gmail com>
Date: Fri Aug 28 11:13:13 2015 +0000
Gst::Context: minors
* gstreamer/src/context.{ccg|hg}: wrap _new() method using
_WRAP_METHOD macro, add Gst::Context documentation.
gstreamer/src/context.ccg | 11 +----------
gstreamer/src/context.hg | 36 ++++++++++++++++++++++++++++++++----
2 files changed, 33 insertions(+), 14 deletions(-)
---
diff --git a/gstreamer/src/context.ccg b/gstreamer/src/context.ccg
index f152c8b..71f7f9c 100644
--- a/gstreamer/src/context.ccg
+++ b/gstreamer/src/context.ccg
@@ -1,6 +1,6 @@
/* gstreamermm - a C++ wrapper for gstreamer
*
- * Copyright 2014 The gstreamermm Development Team
+ * Copyright 2014-2015 The gstreamermm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,12 +16,3 @@
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
-namespace Gst {
-
-Glib::RefPtr<Context> Context::create(const Glib::ustring& context_type, bool persistent)
-{
- return Glib::RefPtr<Context>(reinterpret_cast<Context*>(gst_context_new(context_type.c_str(),
persistent)));
-}
-
-}
\ No newline at end of file
diff --git a/gstreamer/src/context.hg b/gstreamer/src/context.hg
index e9f2577..3049598 100644
--- a/gstreamer/src/context.hg
+++ b/gstreamer/src/context.hg
@@ -1,6 +1,6 @@
/* gstreamermm - a C++ wrapper for gstreamer
*
- * Copyright 2014 The gstreamermm Development Team
+ * Copyright 2014-2015 The gstreamermm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/gst.h>
+#include <gst/gstcontext.h>
#include <gstreamermm/miniobject.h>
#include <gstreamermm/structure.h>
@@ -25,14 +25,42 @@ _DEFS(gstreamermm,gst)
namespace Gst
{
+
+/** Lightweight objects to represent element contexts
+ *
+ * Gst::Context is a container object used to store contexts like a device
+ * context, a display server connection and similar concepts that should
+ * be shared between multiple elements.
+ *
+ * Applications can set a context on a complete pipeline by using
+ * Gst::Element::set_context(), which will then be propagated to all
+ * child elements. Elements can handle these in Gst::Element::set_context_vfunc()
+ * and merge them with the context information they already have.
+ *
+ * When an element needs a context it will do the following actions in this
+ * order until one step succeeds:
+ * 1. Check if the element already has a context
+ * 2. Query downstream with Gst::QUERY_CONTEXT for the context
+ * 3. Query upstream with Gst::QUERY_CONTEXT for the context
+ * 4. Post a Gst::MESSAGE_NEED_CONTEXT message on the bus with the required
+ * context types and afterwards check if a usable context was set now
+ * 5. Create a context by itself and post a Gst::MESSAGE_HAVE_CONTEXT message
+ * on the bus.
+ *
+ * Bins will catch Gst::MESSAGE_NEED_CONTEXT messages and will set any previously
+ * known context on the element that asks for it if possible. Otherwise the
+ * application should provide one if it can.
+ *
+ * Since: 1.2
+ */
class Context : public MiniObject
{
_CLASS_OPAQUE_REFCOUNTED(Context, GstContext, NONE, gst_context_ref, gst_context_unref)
- _IGNORE(gst_context_new, gst_context_ref, gst_context_unref)
+ _IGNORE(gst_context_ref, gst_context_unref)
public:
- static Glib::RefPtr<Context> create(const Glib::ustring& context_type, bool persistent);
+ _WRAP_METHOD(static Glib::RefPtr<Gst::Context> create(const Glib::ustring& context_type, bool persistent),
gst_context_new);
_WRAP_METHOD(Glib::RefPtr<Gst::Context> copy(), gst_context_copy)
_WRAP_METHOD(Glib::RefPtr<Gst::Context> copy() const, gst_context_copy, constversion)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]