[gst-devel] Regarding neonhttpsrc

sangita pithadia sangitapithadia at gmail.com
Fri Sep 28 13:24:49 CEST 2007


Hi All,
I have two issues regarding neonhttpsrc


1. When I tried to playback the file using

gst-launch -v playbin uri=
http://127.0.0.1/p-rat.ts
<https://193.164.132.164/servlet/redirect.srv/s1/s0/s0/s721/p1/p-rat.ts>
it works fine.

But instead of playbin if i will use
gst-launch -v neonhttpsrc location=
http://127.0.0.1/p-rat.ts
<https://193.164.132.164/servlet/redirect.srv/s1/s0/s0/s721/p1/p-rat.ts>
! queue ! filesink location=/root/temp.ts



OR




#include <stdio.h>
#include <gst/gst.h>

#include <string.h>

static GstElement *bin,*httpSource,*sink_file,*queue;
GstElement *pipeline;
static GMainLoop *loop;

GstBus *bus;
char url[255];
char outfile[255
]="Test.dump";

gboolean callback_bus(GstBus *bus, GstMessage *message, gpointer data);


int main(int argc,char *argv[])
{

        GstStateChangeReturn Ret=GST_STATE_CHANGE_ASYNC;


//        *printf("\nEnter the http url\n");*
*  //      scanf("%s",url);*

*strcpy(url,"http://127.0.0.1/p-rat.ts
 <https://193.164.132.164/servlet/redirect.srv/s1/s0/s0/s721/p1/p-rat.ts>");*

        gst_init(NULL,NULL);

        loop = g_main_loop_new(NULL,FALSE);
        g_assert(loop!=NULL);

        queue=gst_element_factory_make(
"queue","queue");
        g_assert(queue!=NULL);


        sink_file=gst_element_factory_make(
"filesink","sink_file");
        g_assert(sink_file!=NULL);



         pipeline=gst_pipeline_new(
"pipeline");

         httpSource=gst_element_factory_make("neonhttpsrc","httpSource"
);
         g_assert(httpSource!= NULL);

        gst_bin_add_many(GST_BIN(pipeline),httpSource,queue,sink_file,NULL);


        *if*
(! gst_element_link_many(httpSource,queue,sink_file,NULL))
           {  printf("\nFailed to link elements

\n");
              exit(0);
           }
       gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(pipeline)),callback_bus,NULL);


       g_object_set(G_OBJECT(httpSource),"location",url,NULL);
       g_object_set(G_OBJECT(sink_file),
"location",outfile,NULL);

      g_print("Setting the state of gstreamer to play");
       gst_element_set_state(pipeline,GST_STATE_PLAYING);


*//       g_timeout_add(3000,(GSourceFunc)(Test_pause),NULL);*

       g_main_loop_run(loop);

*return*
1;


}

	
gboolean callback_bus(GstBus *bus, GstMessage *message, gpointer data)
{
    GstState current, pending;
  */* GstStreamInfo *info = data;*/
*
    GstStateChangeReturn ret = GST_STATE_CHANGE_ASYNC;

    *switch*(GST_MESSAGE_TYPE (message))
    {
    *case* GST_MESSAGE_EOS:

*/* change the state of gstreamer to ready */*
        gst_element_set_state (pipeline ,GST_STATE_NULL);
       */* g_main_loop_quit(loop);*/*

*/* Checking the set successfully changed */*
        *while*(GST_STATE_CHANGE_SUCCESS != ret)
        {
            ret = gst_element_get_state (pipeline, &current, &pending,
0);
        }


        g_main_loop_quit(loop);

        *break*;

    *case* GST_MESSAGE_ERROR:
        {
            gchar *pi8Debug;


            GError *pstErr;

            gst_message_parse_error (message, &pstErr, &pi8Debug);
            g_free (pi8Debug);
            g_print (
"Error: %s\n", pstErr->message);
            g_error_free (pstErr);
            g_main_loop_quit (loop);

            *break*;
        }
    *default*:
        *break*;
    }
    *return* 1;
} */* End of Function */
*


    It  gives an error like

Error: Could not initialize supporting library.

2.
Pipeline to play the mpegts file
gst-launch filesrc location=file:///../../ed24p_00.ts ! flutsdemux !
ffdec_mpeg2video ! queue ! videoscale ! ffmpegcolorspace ! xvimagesink

Works fine.
But same pipeline doesnt work for neonhttpsrc

gst-launch neonhttpsrc location=http://127.0.0.1/ed24p_00.ts !
flutsdemux ! ffdec_mpeg2video ! queue ! videoscale ! ffmpegcolorspace
! xvimagesink

Error:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /pipeline0/neonhttpsrc0: Could not initialize
supporting library.
Additional debug info:
gstneonhttpsrc.c(598): gst_neonhttp_src_start (): /pipeline0/neonhttpsrc0:
Could not begin request (0)
Setting pipeline to NULL ...
FREEING pipeline ...

what can be the cause of this..

Thanks..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070928/bf456927/attachment.htm>


More information about the gstreamer-devel mailing list