[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Re: [gst-devel] dynamic pipeline questions
From:       John Stritch <johnstritch () earthlink ! net>
Date:       2006-11-27 0:43:46
Message-ID: 1164588226.4453.9.camel () goatherder ! stritch-farms
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sun, 2006-11-26 at 02:22 +0100, René Stadler wrote:

> The element is indeed not documented.  Parsing the message like this
> should work (completely untested):
> 
> {
>   const GstStructure *s = gst_message_get_structure (message);
>   const gchar *name = gst_structure_get_name (s);
> 
>   if (g_str_equal (name, "cutter")) {
>     gboolean above;
>     GstClockTime timestamp;
> 
>     if (gst_structure_get_boolean (s, "above", &above)
>         && gst_structure_get_clock_time (s, "timestamp", &timestamp)) {
> 
>       do_something (above, timestamp);
>     }
>   }
> }
> 
> Where "message" is a GstMessage of type GST_MESSAGE_ELEMENT coming from
> the bus.  Your application should already interact with the pipeline's
> bus to implement error handling.  Refer to the application development
> manual and the core reference for more information.
> 
> Regards,
>   René Stadler

That was the ticket!  I now have a single file that grows when there is
sound above the threshold I specify (0.01 (-40dB) seems good right now).

On to other aspects of the application.

Thanks for the help,
John

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.12.1">
</HEAD>
<BODY>
On Sun, 2006-11-26 at 02:22 +0100, Ren&#233; Stadler wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">The element is indeed not documented.  Parsing the message like \
this</FONT> <FONT COLOR="#000000">should work (completely untested):</FONT>

<FONT COLOR="#000000">{</FONT>
<FONT COLOR="#000000">  const GstStructure *s = gst_message_get_structure \
(message);</FONT> <FONT COLOR="#000000">  const gchar *name = gst_structure_get_name \
(s);</FONT>

<FONT COLOR="#000000">  if (g_str_equal (name, &quot;cutter&quot;)) {</FONT>
<FONT COLOR="#000000">    gboolean above;</FONT>
<FONT COLOR="#000000">    GstClockTime timestamp;</FONT>

<FONT COLOR="#000000">    if (gst_structure_get_boolean (s, &quot;above&quot;, \
&amp;above)</FONT> <FONT COLOR="#000000">        &amp;&amp; \
gst_structure_get_clock_time (s, &quot;timestamp&quot;, &amp;timestamp)) {</FONT>

<FONT COLOR="#000000">      do_something (above, timestamp);</FONT>
<FONT COLOR="#000000">    }</FONT>
<FONT COLOR="#000000">  }</FONT>
<FONT COLOR="#000000">}</FONT>

<FONT COLOR="#000000">Where &quot;message&quot; is a GstMessage of type \
GST_MESSAGE_ELEMENT coming from</FONT> <FONT COLOR="#000000">the bus.  Your \
application should already interact with the pipeline's</FONT> <FONT \
COLOR="#000000">bus to implement error handling.  Refer to the application \
development</FONT> <FONT COLOR="#000000">manual and the core reference for more \
information.</FONT>

<FONT COLOR="#000000">Regards,</FONT>
<FONT COLOR="#000000">  Ren&#233; Stadler</FONT>
</PRE>
</BLOCKQUOTE>
That was the ticket!&nbsp; I now have a single file that grows when there is sound \
above the threshold I specify (0.01 (-40dB) seems good right now).<BR> <BR>
On to other aspects of the application.<BR>
<BR>
Thanks for the help,<BR>
John
</BODY>
</HTML>



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic