Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utilities: Clutter Gst 3.0.26
 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Clutter Gst 3.0.26 Reference Manual">
<link rel="up" href="ch05.html" title="ClutterGst utils">
<link rel="prev" href="clutter-gst-Types.html" title="Types">
<link rel="next" href="clutter-gst-Versioning-Macros.html" title="Versioning Macros">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#clutter-gst-Utilities.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch05.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="clutter-gst-Types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="clutter-gst-Versioning-Macros.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="clutter-gst-Utilities"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="clutter-gst-Utilities.top_of_page"></a>Utilities</span></h2>
<p>Utilities — Utility functions for Clutter-Gst.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="clutter-gst-Utilities.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">ClutterInitError</span>
</td>
<td class="function_name">
<a class="link" href="clutter-gst-Utilities.html#clutter-gst-init" title="clutter_gst_init ()">clutter_gst_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">ClutterInitError</span>
</td>
<td class="function_name">
<a class="link" href="clutter-gst-Utilities.html#clutter-gst-init-with-args" title="clutter_gst_init_with_args ()">clutter_gst_init_with_args</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../gstreamer/GstElement.html#GstElement-struct"><span class="returnvalue">GstElement</span></a> *
</td>
<td class="function_name">
<a class="link" href="clutter-gst-Utilities.html#clutter-gst-create-video-sink" title="clutter_gst_create_video_sink ()">clutter_gst_create_video_sink</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="clutter-gst-Utilities.description"></a><h2>Description</h2>
<p>The <span class="application">Clutter-Gst</span> library should be initialized
with <a class="link" href="clutter-gst-Utilities.html#clutter-gst-init" title="clutter_gst_init ()"><code class="function">clutter_gst_init()</code></a> before it can be used. You should pass pointers to
the main argc and argv variables so that GStreamer, Clutter and Clutter-Gst
gst can process their own command line options, as shown in the following
example:</p>
<div class="example">
<a name="id-1.6.3.4.3"></a><p class="title"><b>Example 1. Initializing the Clutter-Gst library</b></p>
<div class="example-contents"><pre class="programlisting">
int
main (int argc, char *argv[])
{
  // initialize the Clutter-Gst library
  clutter_gst_init (&amp;argc, &amp;argv);
  ...
}
</pre></div>
</div>
<br class="example-break"><p>It's allowed to pass two NULL pointers to <a class="link" href="clutter-gst-Utilities.html#clutter-gst-init" title="clutter_gst_init ()"><code class="function">clutter_gst_init()</code></a> in case you
don't want to pass the command line arguments to GStreamer, Clutter and
Clutter-Gst.</p>
<p>You can also use a <span class="type">GOptionEntry</span> array to initialize your own parameters
as shown in the next code fragment:</p>
<div class="example">
<a name="id-1.6.3.4.6"></a><p class="title"><b>Example 2. Initializing the Clutter-Gst library with additional options</b></p>
<div class="example-contents"><pre class="programlisting">
static GOptionEntry options[] =
{
  { "framerate", 'f', 0, G_OPTION_ARG_INT, &amp;opt_framerate,
    "Number of frames per second", NULL },
  { "fourcc", 'o', 0, G_OPTION_ARG_STRING,
     &amp;opt_fourcc, "Fourcc of the wanted YUV format", NULL },
  { NULL }
};

int
main (int argc, char *argv[])
{
   GError           *error = NULL;
   gboolean          result;

   if (!g_thread_supported ())
     g_thread_init (NULL);

   result = clutter_gst_init_with_args (&amp;argc, &amp;argv,
                                        " - Test YUV frames uploading",
                                        options, NULL, &amp;error);

   if (error)
     {
       g_print ("%s\n", error-&gt;message);
       g_error_free (error);
       return EXIT_FAILURE;
     }
  ...
}
</pre></div>
</div>
<br class="example-break">
</div>
<div class="refsect1">
<a name="clutter-gst-Utilities.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="clutter-gst-init"></a><h3>clutter_gst_init ()</h3>
<pre class="programlisting"><span class="returnvalue">ClutterInitError</span>
clutter_gst_init (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                  <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre>
<p>Utility function to initialize both Clutter and GStreamer.</p>
<p>This function should be called before calling any other GLib functions. If
this is not an option, your program must initialise the GLib thread system
using <code class="function">g_thread_init()</code> before any other GLib functions are called.</p>
<div class="refsect3">
<a name="clutter-gst-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p>The number of arguments in <em class="parameter"><code>argv</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p>A pointer to an array. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="clutter-gst-init.returns"></a><h4>Returns</h4>
<p> A <span class="type">ClutterInitError</span>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="clutter-gst-init-with-args"></a><h3>clutter_gst_init_with_args ()</h3>
<pre class="programlisting"><span class="returnvalue">ClutterInitError</span>
clutter_gst_init_with_args (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                            <em class="parameter"><code><span class="type">char</span> ***argv</code></em>,
                            <em class="parameter"><code>const <span class="type">char</span> *parameter_string</code></em>,
                            <em class="parameter"><code><span class="type">GOptionEntry</span> *entries</code></em>,
                            <em class="parameter"><code>const <span class="type">char</span> *translation_domain</code></em>,
                            <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>This function does the same work as <a class="link" href="clutter-gst-Utilities.html#clutter-gst-init" title="clutter_gst_init ()"><code class="function">clutter_gst_init()</code></a>. Additionally, it
allows you to add your own command line options, and it automatically
generates nicely formatted --help output. Clutter's and GStreamer's
<span class="type">GOptionGroup</span>s are added to the set of available options.</p>
<p>Your program must initialise the GLib thread system using <code class="function">g_thread_init()</code>
before any other GLib functions are called.</p>
<div class="refsect3">
<a name="clutter-gst-init-with-args.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p>The number of arguments in <em class="parameter"><code>argv</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p>A pointer to an array. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>parameter_string</p></td>
<td class="parameter_description"><p>a string which is displayed in
the first line of <code class="option">--help</code> output, after
<code class="literal"><em class="replaceable"><code>programname</code></em> [OPTION...]</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entries</p></td>
<td class="parameter_description"><p>a <code class="literal">NULL</code>-terminated array of <span class="type">GOptionEntry</span>s
describing the options of your program</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>translation_domain</p></td>
<td class="parameter_description"><p>a translation domain to use for translating
the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
with <code class="function">gettext()</code>, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a return location for errors</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="clutter-gst-init-with-args.returns"></a><h4>Returns</h4>
<p> <code class="literal">CLUTTER_INIT_SUCCESS</code> on success, a negative integer
on failure.</p>
</div>
<p class="since">Since: 1.0</p>
</div>
<hr>
<div class="refsect2">
<a name="clutter-gst-create-video-sink"></a><h3>clutter_gst_create_video_sink ()</h3>
<pre class="programlisting"><a href="../gstreamer/GstElement.html#GstElement-struct"><span class="returnvalue">GstElement</span></a> *
clutter_gst_create_video_sink (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <a class="link" href="clutter-gst-Video-Sink.html#ClutterGstVideoSink"><span class="type">ClutterGstVideoSink</span></a> initialized with Clutter's Cogl context.</p>
<div class="refsect3">
<a name="clutter-gst-create-video-sink.returns"></a><h4>Returns</h4>
<p>the newly created <a class="link" href="clutter-gst-Video-Sink.html#ClutterGstVideoSink"><span class="type">ClutterGstVideoSink</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="clutter-gst-Utilities.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>