[gst-devel] Issue with decodebin ?
Darren Staples
dstaples at friendmts.co.uk
Thu Jan 8 15:13:29 CET 2009
Hi again :)
Is there an issue with using the decodebin element programmatically ?
This command line works fine:
gst-launch filesrc location=file.flv ! decodebin ! ffmpegcolorspace !
ximagesink
But when I try to code it up as follows: (some code left out for clarity)
// Create gstreamer elements
pipeline = gst_pipeline_new( "video" );
source = gst_element_factory_make( "filesrc" , "src" );
decoder = gst_element_factory_make( "decodebin" , "decoder" );
colorspace1 = gst_element_factory_make( "ffmpegcolorspace" , "colorspace1"
);
sink = gst_element_factory_make( "ximagesink" , "sink" );
if ( !pipeline || !source || !decoder || !colorspace1 || !sink )
{
g_printerr( "One element could not be created. Exiting.\n" );
return -1;
}
// Set the input filename to the source element
g_object_set( G_OBJECT( source ) , "location" , "file.flv" , NULL );
// Add all elements into the pipeline
gst_bin_add_many( GST_BIN( pipeline ) , source , decoder , colorspace1 ,
sink , NULL );
// Start linking the elements together
gst_element_link_many( source , decoder , colorspace1 , sink , NULL );
// Set the pipeline to "playing" state
gst_element_set_state( pipeline , GST_STATE_PLAYING );
I get an Ointernal data flow error¹ as you would see when linking failed.
Any ideas why this might be please ? Does the uridecodebin work any better ?
Thanks for all the help so far :D
Darren
*** FRIEND MTS LIMITED EMAIL CONFIDENTIALITY ***
This email message and any attachments may
contain information which is confidential or privileged
and is intended for the sole use of the person to
whom it is addressed. If you are not the intended
recipient, be aware that any disclosures, copying,
distribution or use of the contents is prohibited. If you
have received this email message in error, please
notify our office by telephone (+44 (0)121 633 2000)
or email (admin at friendmts.co.uk) immediately. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090108/b3a2bac8/attachment.htm>
More information about the gstreamer-devel
mailing list