[gst-devel] http sink element

sreerenj b bsreerenj at gmail.com
Sat Jan 23 14:33:27 CET 2010


On 1/23/10, gstreamer-devel-request at lists.sourceforge.net
<gstreamer-devel-request at lists.sourceforge.net> wrote:
> Send gstreamer-devel mailing list submissions to
> 	gstreamer-devel at lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> or, via email, send a message with subject or body 'help' to
> 	gstreamer-devel-request at lists.sourceforge.net
>
> You can reach the person managing the list at
> 	gstreamer-devel-owner at lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gstreamer-devel digest..."
>
>
> Today's Topics:
>
>    1. Problems to rip CD using cdparanoiasrc (Pascal Ognibene)
>    2. Re: render-delay base sink property for lip-sync? (pl bossart)
>    3. Re: set same caps for all tee's branches (Stefan Kost)
>    4. Re: http sink element (Stefan Kost)
>    5. Re: render-delay base sink property for lip-sync? (pl bossart)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 22 Jan 2010 21:27:21 +0100
> From: Pascal Ognibene <pognibene at gmail.com>
> Subject: [gst-devel] Problems to rip CD using cdparanoiasrc
> To: gstreamer-devel at lists.sourceforge.net
> Message-ID:
> 	<c82f0f6e1001221227h40405aadxfe3141842736ddf9 at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi all,
>
> I'm trying to rip a CD using a simple gstreamer pipeline - something that is
> already done in several programs,
> but i'd like to understand myself how it works.
>
> In the code below, I basically use the EOS event to seek to the next cd
> track.
> But the behavior I see is weird:
> -the first track is ripped ok
> -I call the start_track_rip function for track 2
> -the program blocks here forever.
>
> I must be doing something really wrong but I can't see what, even by the
> looking at the sources of sound juicer for example.
> Any help is welcome,
>
> - pog
>
> Code below:
> -----------------
>
> #include <glib.h>
> #include <gst/gst.h>
> #include <string.h>
>
> guint current_rip_track = 1;
> guint max_rip_track = 10;
>
> void start_track_rip();
>
> static GMainLoop *loop;
> GstElement *pipeline;
>
> static gboolean
> my_bus_callback(GstBus * bus, GstMessage * message, gpointer data)
> {
>     g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message));
>     switch (GST_MESSAGE_TYPE(message)) {
>     case GST_MESSAGE_ERROR:{
>             GError *err;
>             gchar *debug;
>             gst_message_parse_error(message, &err, &debug);
>             g_print("Error: %s\n", err->message);
>             g_error_free(err);
>             g_free(debug);
>             g_main_loop_quit(loop);
>             break;
>         }
>     case GST_MESSAGE_EOS:
>         if (current_rip_track < max_rip_track) {
>             current_rip_track++;
>             g_print("going to next track %d\n", current_rip_track);
>             start_track_rip();
>         } else {
>             g_print("no more tracks, stopping\n");
>             return FALSE;
>         }
>         break;
>     default:
>         /* unhandled message */
>         break;
>     }
>     return TRUE;
> }
>
> static gboolean cb_print_position(GstElement * pipeline)
> {
>     GstState state, pending_state;
>     static GstFormat format = GST_FORMAT_TIME;
>     gint64 pos, len;
>
>     gst_element_get_state(pipeline, &state, &pending_state, 0);
>     if (state != GST_STATE_PLAYING && pending_state != GST_STATE_PLAYING) {
>         return FALSE;
>     }
>
>     if (gst_element_query_position(pipeline, &format, &pos)
>         && gst_element_query_duration(pipeline, &format, &len)) {
>         g_print("Time: %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "\r",
>             GST_TIME_ARGS(pos), GST_TIME_ARGS(len));
>     }
>     /* call me again */
>     return TRUE;
> }
>
> int main()
> {
>     gst_init(NULL, NULL);
>
>     GstElement *source, *filter, *sink;
>     GstBus *bus;
>
>     // build pipeline
>     pipeline = gst_pipeline_new("rip-pipeline");
>     source = gst_element_factory_make("cdparanoiasrc", "mycdparanoia");
>     filter = gst_element_factory_make("lame", "encoder");
>     sink = gst_element_factory_make("filesink", "myfilesink");
>     gst_bin_add_many(GST_BIN(pipeline), source, filter, sink, NULL);
>
>     if (!gst_element_link_many(source, filter, sink, NULL)) {
>         g_warning("Failed to link pipeline elements!");
>     }
>
>     bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
>     gst_bus_add_watch(bus, my_bus_callback, NULL);
>     gst_object_unref(bus);
>
>     g_object_set(G_OBJECT(source), "device", "/dev/hda", NULL);
>
>     start_track_rip();
>
>     g_print("starting main loop\n");
>
>     GMainLoop *loop = g_main_loop_new(NULL, FALSE);
>     g_main_loop_run(loop);
>
>     /* clean up */
>     gst_element_set_state(pipeline, GST_STATE_NULL);
>     gst_object_unref(pipeline);
>     g_main_loop_unref(loop);
>
>     return (0);
> }
>
> void start_track_rip()
> {
>     gchar buf[2048];
>
>     GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "myfilesink");
>     strcpy(buf, "/tmp/music_");
>     gchar buf2[10];
>     sprintf(buf2, "%02d", current_rip_track);
>     strcat(buf, buf2);
>     strcat(buf, ".mp3");
>     gst_element_set_state(sink, GST_STATE_NULL);
>     g_object_set(G_OBJECT(sink), "location", buf, NULL);
>
>     // seek to track
>     GstElement *cd = gst_bin_get_by_name(GST_BIN(pipeline), "mycdparanoia");
>     g_object_set(G_OBJECT(cd), "track", current_rip_track, NULL);
>     GstStateChangeReturn state_ret =
>         gst_element_set_state(pipeline, GST_STATE_PLAYING);
>
>     if (state_ret == GST_STATE_CHANGE_FAILURE) {
>         g_print("01 state change failed\n");
>     } else if (state_ret == GST_STATE_CHANGE_SUCCESS) {
>         g_print("02 state change successful\n");
>     } else if (state_ret == GST_STATE_CHANGE_ASYNC) {
>         // what am I supposed to do here?
>         g_print("seek async\n");
>         state_ret =
>             gst_element_get_state(pipeline, NULL, NULL, GST_SECOND / 2);
>     }
>
>     g_timeout_add_seconds(1, (GSourceFunc) cb_print_position, pipeline);
> }
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 2
> Date: Fri, 22 Jan 2010 15:12:30 -0600
> From: pl bossart <bossart.nospam at gmail.com>
> Subject: Re: [gst-devel] render-delay base sink property for lip-sync?
> To: Discussion of the development of GStreamer
> 	<gstreamer-devel at lists.sourceforge.net>
> Message-ID:
> 	<6160a5131001221312ked4bd65v2dc18a2e015e0bae at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
>> A sink subclassing basesink can call
>> gst_base_sink_set_render_delay() when the latency towards the backend has
>> changed. This posts a latency message to the application (bus) and updates
>> the sink latency.
>> The new latency is used in gst_base_sink_do_sync() which is used by
>> gst_base_sink_render_object() and that finaly is used from the chin
>> function.
>>
>> I think it should work fine :)
>
> Thanks Stefan. What I was thinking of is indeed to call
> gst_base_sink_set_render_delay() when pulseaudio updates the latency
> information in gst_pulsering_stream_latency_cb(). However I am not
> sure the sink latency (the time needed for a new sample to be played)
> is compatible with the gstreamer expectations at the pipeline level.
> The latency reported by pulseaudio is initially zero in a prerolled
> state, and it'll increase during the first seconds until the reported
> latency oscillates around a stable value.
>
> Along the same line, pulseaudio updates the latency every second or
> so, not sure what the effect is if the pipeline latency is changed too
> often.
>
> Last, do video sinks update the render-delay information as well? If
> only the audio sink updates the back-end delay, we might end-up with a
> worse experience...
> Thanks for your feedback
> - Pierre
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 22 Jan 2010 23:46:40 +0200
> From: Stefan Kost <ensonic at hora-obscura.de>
> Subject: Re: [gst-devel] set same caps for all tee's branches
> To: Miron Kunz <mironoz at mail.ru>, Discussion of the development of
> 	GStreamer	<gstreamer-devel at lists.sourceforge.net>
> Message-ID: <4B5A1CC0.8040907 at hora-obscura.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Am 19.01.2010 21:35, schrieb Miron Kunz:
>>
>> Hi,
>>
>> I have a pipeline ...!rtpdepay! alawdec ! tee name=m ! queue
>> !audioconvert!audiosink m.!queue!audioconvert!monoscope!fakesink.
>>
>> Monoscope and audiosink are using different number of channles and this
>> leads to caps change while pushing data to alawdec's sink. Which in turn
>> results in "non-negotiated" and stop of data flow.
>>
>> How can I assure that 2 branches after the tee end up with the same
>> capabilities?
>>
>> I tried to use same caps filter before the queue element on each branch
>> but it did not help.
>
> How did you use it? Becasue thats exactly what you should do - use a
> capsfilter
> and fixate the properties that would otherwise be renegotiated.
>
> Stefan
>
>>
>> Thanks,
>> Miron.
>>
>> ------------------------------------------------------------------------------
>> Throughout its 18-year history, RSA Conference consistently attracts the
>> world's best and brightest in the field, creating opportunities for
>> Conference
>> attendees to learn about information security's most important issues
>> through
>> interactions with peers, luminaries and emerging and established
>> companies.
>> http://p.sf.net/sfu/rsaconf-dev2dev
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 22 Jan 2010 23:51:25 +0200
> From: Stefan Kost <ensonic at hora-obscura.de>
> Subject: Re: [gst-devel] http sink element
> To: arnabsamanta <arnabsamanta at tataelxsi.co.in>, 	Discussion of the
> 	development of GStreamer	<gstreamer-devel at lists.sourceforge.net>
> Message-ID: <4B5A1DDD.5060702 at hora-obscura.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Am 21.01.2010 07:13, schrieb arnabsamanta:
>> Hello Developers,
>>
>> Do we have any Http sink plugin in Gstreamer ?
>> If so , in which package do we have it ?
>>
>> I guess we have a http src element from NEON and SOUP
>> But I could not find any sink element in HTTP.
>
> That would be a http server and that does not make sense so much as a
> gstreamer
> sink. You need to write a sever application. E.g. have a look at rygel (upnp
> media server using gstreamer).
>
> stefan
>
HI,

Stefan, You mean we can give the input to rygel as a gstreamer
pipeline so that rygel will act as an http server?

>>
>> Regards,
>> Arnab
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Throughout its 18-year history, RSA Conference consistently attracts the
>> world's best and brightest in the field, creating opportunities for
>> Conference
>> attendees to learn about information security's most important issues
>> through
>> interactions with peers, luminaries and emerging and established
>> companies.
>> http://p.sf.net/sfu/rsaconf-dev2dev
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 22 Jan 2010 16:22:12 -0600
> From: pl bossart <bossart.nospam at gmail.com>
> Subject: Re: [gst-devel] render-delay base sink property for lip-sync?
> To: Discussion of the development of GStreamer
> 	<gstreamer-devel at lists.sourceforge.net>
> Message-ID:
> 	<6160a5131001221422h527811a9rb52b24cc56a52aaf at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
>> Thanks Stefan. What I was thinking of is indeed to call
>> gst_base_sink_set_render_delay() when pulseaudio updates the latency
>> information in gst_pulsering_stream_latency_cb().
>
> This is what I had in mind. Seems to update the pipeline latency every
> second or so.
> -Pierre
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: 0001-pulsesink-fix-lip-sync-by-providing-sink-latency-to-.patch
> Type: text/x-patch
> Size: 1792 bytes
> Desc: not available
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
>
> ------------------------------
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> End of gstreamer-devel Digest, Vol 44, Issue 30
> ***********************************************
>


-- 
Sreerenj B
Software engineer,Carinov Networks Pvt Ltd
bsreerenj at gmail.com
mob: +91 9739469496




More information about the gstreamer-devel mailing list