[Bug 758060] gst_mini_object_unlock: assertion 'state >= SHARE_ONE' failed
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Fri Nov 13 06:59:45 PST 2015
https://bugzilla.gnome.org/show_bug.cgi?id=758060
--- Comment #1 from bill-auger <bill-auger at programmer.net> ---
Comment on attachment 315406
--> https://bugzilla.gnome.org/attachment.cgi?id=315406
minimal pipeline exposing this bug
>/*
> g++ `pkg-config --cflags gstreamer-1.0` ./pngdec.cpp \
> `pkg-config --libs gstreamer-1.0` -o ./pngdec
>*/
>
>#include <gst/gst.h>
>#include <stdio.h>
>#include <unistd.h>
>
>
>GstElement *Pipeline , *ImageBin , *CompositorBin ;
>
>
>bool newGhostPad(GstElement* a_bin , GstElement* an_element ,
> const gchar* pad_template , const gchar* public_id )
>{
> GstPad *private_pad , *public_pad ;
>
> bool is_err = !(private_pad = gst_element_get_static_pad(an_element , pad_template)) ||
> !(public_pad = gst_ghost_pad_new (public_id , private_pad )) ||
> !gst_pad_set_active(public_pad , TRUE) ;
> gst_object_unref(private_pad) ;
>
> if (is_err || a_bin == NULL|| !gst_element_add_pad(a_bin , public_pad))
> return false ;
>
> return true ;
>}
>
>int configureImageBin()
>{
>#define IMAGE_W "640"
>#define IMAGE_H "480"
>#define IMAGE_FILENAME "a.png"
>#define SCALER_CAPS_STR "video/x-raw, " \
> "width=(int)"IMAGE_W", " \
> "height=(int)"IMAGE_H", " \
> "framerate=(fraction)0/1, " \
> "format=(string)YUY2," \
> "interlace-mode=(string)progressive, " \
> "pixel-aspect-ratio=(fraction)1/1"
>#define FREEZER_CAPS_STR "video/x-raw, " \
> "width=(int)"IMAGE_W", " \
> "height=(int)"IMAGE_H", " \
> "framerate=(fraction)8/1, " \
> "format=(string)YUY2," \
> "interlace-mode=(string)progressive, " \
> "pixel-aspect-ratio=(fraction)1/1"
>
>
> GstElement *source , *decoder , *converter ,
> *scaler , *scaler_filter ,
> *freezer , *freezer_filter , *queue ;
> GstCaps *scaler_caps , *freezer_caps ;
>
> // instantiate elements
> if (!(source = gst_element_factory_make("filesrc" , "image-real-source" )) ||
> !(decoder = gst_element_factory_make("pngdec" , "image-decoder" )) ||
> !(converter = gst_element_factory_make("videoconvert" , "image-converter" )) ||
> !(scaler = gst_element_factory_make("videoscale" , "image-scaler" )) ||
> !(scaler_filter = gst_element_factory_make("capsfilter" , "image-scaler-caps" )) ||
> !(freezer = gst_element_factory_make("imagefreeze" , "image-freezer" )) ||
> !(freezer_filter = gst_element_factory_make("capsfilter" , "image-freezer-caps")) ||
> !(queue = gst_element_factory_make("queue" , "image-queue" )) ||
> !(scaler_caps = gst_caps_from_string(SCALER_CAPS_STR ) ) ||
> !(freezer_caps = gst_caps_from_string(FREEZER_CAPS_STR) ) )
> { printf("IMAGE_BIN_INIT_ERROR_MSG\n") ; return false ; }
>
> // configure elements
> g_object_set(G_OBJECT(source ) , "location" , IMAGE_FILENAME , NULL) ;
> g_object_set(G_OBJECT(scaler_filter ) , "caps" , scaler_caps , NULL) ;
> g_object_set(G_OBJECT(freezer_filter) , "caps" , freezer_caps , NULL) ;
> g_object_set(G_OBJECT(queue ) , "max-size-bytes" , (guint)0 , NULL) ;
> g_object_set(G_OBJECT(queue ) , "max-size-time" , (guint64)0 , NULL) ;
> g_object_set(G_OBJECT(queue ) , "max-size-buffers" , (guint)0 , NULL) ;
> gst_caps_unref(scaler_caps) ; gst_caps_unref(freezer_caps) ;
>
> // link elements
> if (!gst_bin_add(GST_BIN(ImageBin) , source ) ||
> !gst_bin_add(GST_BIN(ImageBin) , decoder ) ||
> !gst_bin_add(GST_BIN(ImageBin) , converter ) ||
> !gst_bin_add(GST_BIN(ImageBin) , scaler ) ||
> !gst_bin_add(GST_BIN(ImageBin) , scaler_filter ) ||
> !gst_bin_add(GST_BIN(ImageBin) , freezer ) ||
> !gst_bin_add(GST_BIN(ImageBin) , freezer_filter) ||
> !gst_bin_add(GST_BIN(ImageBin) , queue ) ||
> !gst_element_link(source , decoder ) ||
> !gst_element_link(decoder , converter ) ||
> !gst_element_link(converter , scaler ) ||
> !gst_element_link(scaler , scaler_filter ) ||
> !gst_element_link(scaler_filter , freezer ) ||
> !gst_element_link(freezer , freezer_filter) ||
> !gst_element_link(freezer_filter , queue ) ||
> !newGhostPad(ImageBin , queue , "src" , "image-source") )
> { printf("IMAGE_BIN_LINK_ERROR_MSG\n") ; return false ; }
>
> return true ;
>}
>
>
>int main(int argc , char* argv[])
>{
> GstElement* sink ;
>
> gst_init(NULL , NULL) ;
>
> Pipeline = gst_pipeline_new("pipeline" ) ;
> ImageBin = gst_bin_new ("image-bin") ;
> CompositorBin = gst_bin_new ("compositor-bin") ;
>
> gst_bin_add(GST_BIN(Pipeline) , ImageBin ) ;
> gst_bin_add(GST_BIN(Pipeline) , CompositorBin) ;
>
> if (!(sink = gst_element_factory_make("xvimagesink" , "image-sink")) ||
> !gst_bin_add(GST_BIN(CompositorBin) , sink) ||
> !newGhostPad(CompositorBin , sink , "sink" , "image-sink") )
> return 255 ;
>
> if (!configureImageBin()) return 255 ;
>
> if (!gst_element_link(ImageBin , CompositorBin)) return 255 ;
>
> gst_element_set_state(Pipeline , GST_STATE_PLAYING) ;
>
> usleep(10000000);
>
> gst_element_set_state(Pipeline , GST_STATE_NULL) ; // this line cause the berserk
> gst_object_unref(Pipeline) ;
>
> return 0 ;
>}
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list