Pipeline for on-disk buffering using queue2 element

Bhavya bhavyar.1992 at gmail.com
Mon Jul 6 06:16:14 PDT 2015


Hi all,

I tried to replicate as it is done in playbin in my sample app. But it
stucks in gst_queue2_create_read function, length is -1  in
gst_queue2_get_range function

Please help me out.

0:00:00.567787666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:477:gst_queue2_init:<GstQueue2 at 0x148070> initialized queue's
not_em
pty & not_full conditions
typefind found caps video/x-msvideoline
link success
0:00:00.568476999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1426:gst_queue2_open_temp_location_file:<queue2> opening temp
file 
/TestingXXXXXX
0:00:00.568747999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1467:gst_queue2_open_temp_location_file:<queue2> opened temp
file /
TestingXXXXXX
0:00:00.568817332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:633:init_ranges:<queue2> init queue ranges
0:00:00.568869332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:527:clean_ranges:<queue2> clean queue ranges
0:00:00.568934332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:579:add_range:<queue2> find range for 0
0:00:00.568993999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:554:find_range:<queue2> no range for 0
0:00:00.569046332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:588:add_range:<queue2> new range 0-0
0:00:00.569099332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:519:debug_ranges:<queue2> range [0-0] (rb [0-0]), reading 0
current
 range?   n  
0:00:00.569174332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2988:gst_queue2_src_activate_push:<queue2> activating push mode
0:00:00.569646332  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2954:gst_queue2_sink_activate_push:<queue2> activating push mode
Video Queue synced state with parent pipeline

(download:1779): GLib-GObject-WARNING **: g_object_set_valist: object class
`GstBin' has no property named `sink-caps'
0:00:00.570707000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2998:gst_queue2_src_activate_push:<queue2> deactivating push
mode
0:00:00.571135333  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1474:gst_queue2_open_temp_location_file:<queue2> temp file was
alre
ady open
0:00:00.571206000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:3036:gst_queue2_src_activate_pull:<queue2> activating pull mode
0:00:00.571260000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:633:init_ranges:<queue2> init queue ranges
0:00:00.571311000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:527:clean_ranges:<queue2> clean queue ranges
0:00:00.571362666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:579:add_range:<queue2> find range for 0
0:00:00.571416000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:554:find_range:<queue2> no range for 0
0:00:00.571467000  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:588:add_range:<queue2> new range 0-0
0:00:00.571520999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:519:debug_ranges:<queue2> range [0-0] (rb [0-0]), reading 0
current
 range?   n  
0:00:00.571638999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2696:gst_queue2_handle_src_query:<queue2> doing peer query
0:00:00.902968666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2701:gst_queue2_handle_src_query:<queue2> peer query success
0:00:00.915704333  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:2879:gst_queue2_get_range:<queue2> Getting range: offset 0,
length 
4096
0:00:00.915986666  1779    0x20c30 INFO                  queue2
gstqueue2.c:2860:gst_queue2_update_upstream_size:<queue2> upstream size:
881193
92
0:00:00.916132999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1247:gst_queue2_create_read:<queue2> Reading 4096 bytes from 0
0:00:00.916246666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1115:gst_queue2_have_data:<queue2> looking for offset 0, len
4096
0:00:00.916353666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:552:find_range:<queue2> found range for 0: [0-0]
0:00:00.916458333  1779    0x20c30 INFO                  queue2
gstqueue2.c:1124:gst_queue2_have_data:<queue2> cur_level.bytes 0 (max 0)
0:00:00.916560333  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1129:gst_queue2_have_data:<queue2> we have a range 0x146aa8,
offset
 0, writing_pos 0
0:00:00.916710999  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1139:gst_queue2_have_data:<queue2> Need more data (4096 bytes
more)
0:00:00.916815666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1270:gst_queue2_create_read:<queue2> reading 0, writing 0, level
0
0:00:00.916922666  1779    0x20c30 DEBUG                 queue2
gstqueue2.c:1306:gst_queue2_create_read:<queue2> waiting for add


code snippet :
type_found (GstElement * typefind, guint probability,
        GstCaps * caps, gpointer* pvData)
{
    GstElement *pipeline = NULL, *queue_download, *typefind1, *demuxer;
    GstPad * typefind_pad, *newpad, *demuxer_pad, *typefind_src_pad,
*source_src_pad, *queue_download_src;
    GstPadTemplate *templ, *pad_tmpl_src;
    pipeline = (GstElement *)pvData;
    printf ("typefind found caps %" GST_PTR_FORMAT, caps);
    GstElement* bin =
        gst_bin_get_by_name((GstBin*)(pipeline),
                "bin_download");
    GstElement* bin1 =
        gst_bin_get_by_name((GstBin*)(pipeline),
                "decodebin");
    typefind1 = gst_element_factory_make ("typefind",
            "typefind");
    gst_bin_add(bin1, typefind1);
    typefind_pad = gst_element_get_static_pad (typefind1, "sink");
    templ = gst_static_pad_template_get (&sinktemplate);
    newpad = gst_ghost_pad_new_from_template ("sink", typefind_pad, templ);
    gst_pad_set_active (newpad, TRUE);
    gst_element_add_pad (GST_ELEMENT (bin1), newpad);

    queue_download = gst_element_factory_make("queue2",
            "queue2");
    printf("line\n");
   
g_object_set(G_OBJECT(queue_download),"temp-template","/TestingXXXXXX",NULL);
    g_object_set(G_OBJECT(queue_download),"temp-remove", 0,NULL);
    g_object_set(G_OBJECT(queue_download),"use-buffering", 0,NULL);
    g_object_set(G_OBJECT(queue_download),"max-size-time",(guint64)0,NULL);
    g_object_set(G_OBJECT(queue_download),"max-size-buffers",(guint)0,NULL);
    g_object_set(G_OBJECT(queue_download),"max-size-bytes",(guint)0,NULL);
    gst_bin_add(bin, queue_download);
    gst_element_link(typefind, queue_download);
    printf("link success\n");
    if(TRUE == gst_element_sync_state_with_parent (queue_download))
    {
        printf ("Video Queue synced state with parent pipeline\n");
    }
    else
    {
        printf ("Video Queue coudldn't sync state with parent pipiline\n");
    }
    queue_download_src = gst_element_get_static_pad (queue_download, "src");
    gst_pad_link(queue_download_src, newpad);
    demuxer = gst_element_factory_make("aiurdemux",
            "demuxer");
    gst_bin_add(bin1, demuxer);

    gst_element_link(typefind1, demuxer);
    if(TRUE == gst_element_sync_state_with_parent (typefind1))
    {
        printf ("Video Queue synced state with parent pipeline\n");
    }
    else
    {
        printf ("Video Queue coudldn't sync state with parent pipiline\n");
    }
    if(TRUE == gst_element_sync_state_with_parent (demuxer))
    {
        printf ("Video Queue synced state with parent pipeline\n");
    }
    else
    {
        printf ("Video Queue coudldn't sync state with parent pipiline\n");
    }
    g_signal_connect(demuxer, "pad-added",
            G_CALLBACK(gstreamer_on_pad_added), pipeline);
}

gstreamer_on_pad_added () will further link decoder and sink.
main()
{
    bin = gst_bin_new("bin_download");
    bin1 = gst_bin_new("decodebin");
    pipeline = gst_pipeline_new("pipeline");
    gst_bin_add (GST_BIN (pipeline), bin);
    gst_bin_add (GST_BIN (bin), bin1);
    source = gst_element_factory_make("souphttpsrc",
            "source");
    g_object_set(G_OBJECT(source), "location",
            "http://192.168.0.144/big.avi", NULL);
    gst_bin_add(bin, source);
    printf("line\n");
    typefind = gst_element_factory_make ("typefind",
            "typefindelement");
    gst_bin_add(bin, typefind);
    gst_element_link(source, typefind);
    g_signal_connect (G_OBJECT (typefind), "have-type",
            G_CALLBACK (type_found), pipeline);
}

Thanks in advance.

Regards,
Bhavya R






--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Pipeline-for-on-disk-buffering-using-queue2-element-tp4672538p4672572.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list