Which gstreamer plug-in source code to reffer ?

ssshukla26 ssshukla26 at gmail.com
Sun Jan 17 21:30:48 PST 2016


It worked by the below method,

In handle_frame function I have used
*gst_video_encoder_allocate_output_frame* function to allocate output
buffer. 

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 
    {   
        *gst_video_encoder_allocate_output_frame
(encoder,frame,ip_info.size);*
        GstMapInfo op_info;
        gst_buffer_map(frame->output_buffer, &op_info, GST_MAP_WRITE);
        memcpy(op_info.data,ip_info.data,ip_info.size);
        gst_buffer_unmap(frame->output_buffer, &op_info);
    }   
    gst_buffer_unmap(input_buffer, &ip_info);

    if(ret != GST_FLOW_EOS)
    {   
        ret = gst_video_encoder_finish_frame (encoder,frame);
    }   

    return ret;
}


Thanks guyz for so much help from your side. Appreciate your support.



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


More information about the gstreamer-devel mailing list