Gstreamer in ekiga

Wim Taymans wim.taymans at gmail.com
Mon Oct 1 03:55:20 PDT 2012


You are senfding a wav file through appsrc, you must use wavparse, like 
this:

helper = gst_helper_new ("appsrc name=ekiga_src ! wavparse ! pulsesink 
name=ekiga_volume");

If you don't, it sends the complete wav file to pulsesink, which 
complains because it
is not of the expected size (it has a header that is not a multiple of 
the frame size).

Wim

On 09/30/2012 04:38 PM, Julien Puydt wrote:
> Hi,
>
> I have been fighting again to get my gstreamer code in ekiga in a less 
> experimental state these last days, with the help of the good people 
> of the irc channel.
>
> Today I wrote a simple program showing a similar problem to one I see 
> in ekiga : sound events mostly work, except for a single one!
>
> So here is how to reproduce the problem:
> - I quote a Makefile and a test.cpp files in the post-scriptum of this 
> mail ;
> - the needed gst-helper.cpp and gst-helper.h are those from 
> http://git.gnome.org/browse/ekiga/tree/plugins/gstreamer ;
> - the wav files can be found here: 
> http://git.gnome.org/browse/ekiga/tree/sounds (only ring.wav and 
> newmessage.wav matter) ;
> - 'make' should build the "test" program from those.
>
> Running "./test ring.wav" plays the sound correctly, "./test 
> newmessage.wav" doesn't. [Hit ctrl+C to get out of the main loop.]
>
> (Notice those are the two files for which the rate, channels, etc 
> settings agree with those in the code, which is why I limit the 
> discussion to those two.)
>
> What is wrong with my code, and how to fix it?
>
> Thanks,
>
> Snark on #gstreamer
>
> PS1: Makefile is:
> PKGS = glib-2.0 gstreamer-plugins-base-0.10 gio-2.0
> CPPFLAGS = -Wall -O2 `pkg-config --cflags $(PKGS)`
> LDFLAGS = `pkg-config --libs $(PKGS)` -lgstapp-0.10
>
> test: test.o gst-helper.o
>
> test.o: test.cpp
>
> gst-helper.o: gst-helper.h gst-helper.cpp
>
> PS2: test.cpp is:
> #include <gio/gio.h>
> #include <gst/gst.h>
>
> #include "gst-helper.h"
>
> gst_helper* helper = NULL;
>
> static void
> read_callback (GInputStream* stream,
>            GAsyncResult* result,
>            gchar* buffer)
> {
>   gssize size = g_input_stream_read_finish (stream, result, NULL);
>
>   gst_helper_set_frame_data (helper, buffer, size);
>
>   gst_helper_close (helper);
>
>   g_free (buffer); /* stupid: I'm leaking everywhere anyway */
> }
>
> static void
> size_callback (GFileInputStream* stream,
>            GAsyncResult* result,
>            G_GNUC_UNUSED gpointer data)
> {
>   GFileInfo* info = g_file_input_stream_query_info_finish (stream, 
> result, NULL);
>
>   if (info) {
>
>     goffset size = g_file_info_get_size (info);
>     gchar* buffer = g_new0 (gchar, size);
>
>     g_input_stream_read_async (G_INPUT_STREAM (stream), buffer, size, 
> 0, NULL,
>                    (GAsyncReadyCallback)read_callback, buffer);
>   }
> }
>
> static void
> opened_callback(GFile* file,
>         GAsyncResult* result,
>         G_GNUC_UNUSED gpointer data)
> {
>   GFileInputStream* stream = g_file_read_finish (file, result, NULL);
>
>   if (stream) {
>
>     g_file_input_stream_query_info_async (stream, 
> G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, NULL,
>                       (GAsyncReadyCallback)size_callback, NULL);
>   }
> }
>
> int
> main (int argc,
>       char* argv[])
> {
>   GMainLoop* loop = g_main_loop_new (NULL, FALSE);
>
>   gst_init (&argc, &argv);
>
>   helper = gst_helper_new ("appsrc is-live=true format=time 
> do-timestamp=true min-latency=1 max-latency=5000000 name=ekiga_src 
> caps=audio/x-raw-int,rate=44100,channels=2,width=16,depth=16,signed=true,endianness=1234 
> ! pulsesink sync=false name=ekiga_volume");
>
>   GFile* file = g_file_new_for_path (argv[1]);
>
>   g_file_read_async (file, 0, NULL, 
> (GAsyncReadyCallback)opened_callback, NULL);
>
>   g_main_loop_run (loop);
>
>   return 0;
> }
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list