Fwd: Use of gstAppSrc and VDPAU treatment...
Jérémy Lauraire
jeremy.lauraire at gmail.com
Tue Jul 5 01:50:01 PDT 2011
Hi,
To precise my problem, here is the result of the GST_DEBUG :
2023.68 Kbps 13 frames received 6.31579 fps Decoding...
Media type video/mpeg, systemstream=(boolean)false, mpegversion=(int)2,
framerate=(fraction)25/1, width=(int)720, height=(int)576 found, probability
100%
0:00:01.858608759 18267 0x23f4550 WARN basevideodecoder
gstbasevideodecoder.c:664:gst_base_video_decoder_chain: Received buffer
without a new-segment. Assuming timestamps start from 0.
2081.5 Kbps 14 frames received 6.5 fps Decoding...
Media type video/mpeg, systemstream=(boolean)false, mpegversion=(int)2,
framerate=(fraction)25/1, width=(int)720, height=(int)576 found, probability
100%
0:00:02.038699964 18267 0x23f4550 *WARN* basevideodecoder
gstbasevideodecoder.c:664:gst_base_video_decoder_chain: Received buffer
without a new-segment. Assuming timestamps start from 0.
0:00:02.038733007 18267 0x23f4550 *ERROR* basevideodecoder
gstbasevideodecoder.c:677:gst_base_video_decoder_chain: new segment event
ret=0
0:00:02.038752871 18267 0x23f4550 *WARN* basesrc
gstbasesrc.c:2582:gst_base_src_loop:<app-src> error: Erreur interne de flux
de données.
0:00:02.038761733 18267 0x23f4550 *WARN* basesrc
gstbasesrc.c:2582:gst_base_src_loop:<app-src> error: streaming task paused,
reason error (-5)
The code I used :
printf("Accelerated vdpau decoding from appsrc...\n");
// Gstreamer initialisation
gst_init (NULL, NULL);
GMainLoop *loop;
GstBus *bus;
GstElement *pipeline, *appsrc, *demuxer, *decoder, *postprocess, *videosink,
*typefind;
loop = g_main_loop_new (NULL, FALSE);
//Create gstreamer elements
pipeline = gst_pipeline_new ("pipeline");
appsrc = gst_element_factory_make ("appsrc", "app-src");
// VDPAU traitement :
decoder = gst_element_factory_make ("vdpaumpegdec", "vdpau-decoder");
postprocess = gst_element_factory_make ("vdpauvideopostprocess",
"vdpau-video-post-process");
videosink = gst_element_factory_make ("vdpausink", "vdpau-sink");
// detection elements
typefind = gst_element_factory_make ("typefind", "typefinder");
g_signal_connect (typefind, "have-type", G_CALLBACK (cb_typefound), loop);
if (!pipeline || !appsrc || !decoder || !videosink || !typefind ||
!postprocess)
{
g_printerr ("One element could not be created. Exiting.\n");
return -1;
}
/* we add a message handler */
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_add_watch (bus, bus_call, loop);
gst_object_unref (bus);
/* set the capabilities of the appsrc element */
GstCaps *caps = gst_caps_new_simple ("video/mpeg",
"systemstream", G_TYPE_BOOLEAN, false,
"mpegversion", G_TYPE_INT, 2,
"framerate",GST_TYPE_FRACTION,25,1,
"width",G_TYPE_INT,720,
"height",G_TYPE_INT,576,
NULL);
gst_app_src_set_caps(GST_APP_SRC(appsrc), caps);
/* we add all elements into the pipeline */
gst_bin_add_many (GST_BIN (pipeline),
appsrc, typefind, decoder, postprocess, videosink, NULL);
gst_element_link_many(appsrc, typefind, decoder, postprocess, videosink,
NULL);
/* play */
printf("Now playing...\n");
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* create the buffer */
int BUFFER_SIZE = _avPacket.size;
GstBuffer *buffer = gst_buffer_new();
GST_BUFFER_DATA (buffer) = _avPacket.data;
GST_BUFFER_SIZE (buffer) = BUFFER_SIZE;
/* push the buffer to pipeline via appsrc */
GstFlowReturn gstFlowReturn = gst_app_src_push_buffer(GST_APP_SRC(appsrc),
buffer);
printf("Return flow value = %d \n", gstFlowReturn);
/* and loop... */
g_main_loop_run (loop);
/* clean up */
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (pipeline));
return 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110705/f4808686/attachment.htm>
More information about the gstreamer-devel
mailing list