Which gstreamer plug-in source code to reffer ?

ssshukla26 ssshukla26 at gmail.com
Thu Jan 14 23:56:36 PST 2016


Just for a proof of concept,

I am doing as follows in GstVideoEncoderClass, am overriding *handle_frame*
function to just copy input buffer to output buffer, that is doing no
processing on input buffer. The code is as follows.

-------------------------------------------------------------------------------------------------------------------
static gboolean *gst_myencoder_open*  (GstVideoEncoder *encoder)
{
    g_print("%s....................\n",__func__);
    return TRUE;
}

static gboolean *gst_myencoder_close* (GstVideoEncoder *encoder)
{
    g_print("%s....................\n",__func__);
    return TRUE;
}

static gboolean *gst_myencoder_start* (GstVideoEncoder *encoder)
{
    g_print("%s....................\n",__func__);
    return TRUE;
}

static gboolean *gst_myencoder_stop*  (GstVideoEncoder *encoder)
{
    g_print("%s....................\n",__func__);
    return TRUE;
}

static GstFlowReturn *gst_myencoder_handle_frame* (GstVideoEncoder
*encoder,GstVideoCodecFrame *frame)
{
    GstFlowReturn ret = GST_FLOW_OK;

    GstBuffer *input_buffer =  frame->input_buffer;
    GstMapInfo ip_info;
    g_print("%s....................\n",__func__);
    gst_buffer_map(input_buffer, &ip_info, GST_MAP_READ);
    if(ip_info.size <= 0)
    {   
        ret = GST_FLOW_EOS;
    }   
    else 
    {   
        GstBuffer *output_buffer =  frame->output_buffer;
        output_buffer = gst_buffer_new_allocate (NULL, ip_info.size, NULL);
        GstMapInfo op_info;
        gst_buffer_map(output_buffer, &op_info, GST_MAP_WRITE);
        memcpy(op_info.data,ip_info.data,ip_info.size);
        gst_buffer_unmap(output_buffer, &op_info);
    }   
    gst_buffer_unmap(input_buffer, &ip_info);
    return ret;
}
-------------------------------------------------------------------------------------------------------------------

I am successfully initializing the plug-in but with the following pipeline
its giving me error. 

*gst-launch-1.0 videotestsrc ! myh264encoder ! autovideosink*

Setting pipeline to PAUSED ...
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
gst_myencoder_open....................
gst_myencoder_start....................
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop ():
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
gst_myencoder_stop....................
gst_myencoder_close....................
Freeing pipeline ...

-------------------------------------------------------------------------------------------------------------------

Please help me out.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Which-gstreamer-plug-in-source-code-to-reffer-tp4675203p4675271.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list