appsink and vaapi

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

appsink and vaapi

Bobry Chaosu
Hi,
I'm new to gstreamer.
I'm trying to make a pipe "filesrc ! ffdemux... ! vaapidecode ! appsink" to obtain frame or texture id of accelerated video.
I have alredy made working code with vaapisink, but i have to somehow get frame or texture id, and not show the video (this woud be done in another part of application, using opengl, and showing with other media). I'm not even sure, that appsink is way to go, but this is the best I have found.
To use appsink, I have set cap "video/x-vaapi-surface" and turned on "emit-signals". Flesrc have proper file location.
Elements links ok, but I get "Internal data stream error". Any help?

code fragment:

GstElement *source=gst_element_factory_make("filesrc","source";
GstElement *demuxer=gst_element_factory_make("ffdemux_mov_mp4_m4a_3gp_3g2_mj2","demuxer");
GstElement *decoder=gst_element_factory_make("vaapidecode","decoder");
GstElement *sink=gst_element_factory_make("appsink","sink");
GstElement *pipeline;
pipeline = gst_pipeline_new ("mypipeline");
   
//setting values for appsink
GstCaps *cap = gst_caps_from_string("video/x-vaapi-surface");
gst_app_sink_set_caps((GstAppSink*) sink, cap);
g_object_set (G_OBJECT (sink, "emit-signals", true, NULL);
   
//file location for filesrc
g_object_set (G_OBJECT (filesrc, "location", filePath.toAscii().data(), NULL);
   
//adding to bin
gst_bin_add (GST_BIN (pipeline), source);
gst_bin_add (GST_BIN (pipeline), demuxer);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), sink);
   
//linking
qDebug() << gst_element_link(source,demuxer);
qDebug() << gst_element_link(decoder,sink);
g_signal_connect (demuxer, "pad-added", G_CALLBACK (cb_new_pad), decoder); //linking demuxer with decoder



best regards,
Bober

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel