Please help to understand pre_push functionality in GStVideoEncoderClass ?

ssshukla26 ssshukla26 at gmail.com
Mon Feb 8 15:40:47 UTC 2016


Hi,

I thought that handle_frame and pre_push functions works as top half and
bottom half of an encoding process.

So as per my understanding I did as follows,

*1) under handle_frame function I encoded the incoming frame and stored the
same onto a queue*

static GstFlowReturn *gst_myh264encoder_handle_frame* (GstVideoEncoder
*encoder,GstVideoCodecFrame *frame)
{
    GstFlowReturn ret = GST_FLOW_OK;
    GstBuffer *input_buffer =  frame->input_buffer;
    GstMapInfo ip_info;

    gst_buffer_map(input_buffer, &ip_info, GST_MAP_READ);
    if(0 == ip_info.size)
    {
        g_print("GST_FLOW_EOS in %s @ %d\n",__func__,__LINE__);
        ret = GST_FLOW_EOS;
    }   
    else 
    {
        if(*encode_frame*((void *)ip_info.data,ip_info.size))
        {
            g_print("GST_FLOW_ERROR in %s @ %d\n",__func__,__LINE__);
            ret = GST_FLOW_ERROR;
        }   
    }   
    gst_buffer_unmap(input_buffer, &ip_info);

    return ret;
}

*2) under pre_push function I copied the encoded data from the queue to the
output buffer*

static GstFlowReturn *gst_myh264encoder_pre_push* (GstVideoEncoder
*encoder,GstVideoCodecFrame *frame)
{
    GstFlowReturn ret = GST_FLOW_OK;
  
    if(*fill_output_buffer*(encoder,frame))
        ret = GST_FLOW_ERROR;

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

    return ret;
}

And what I saw is that the *pre_push* functionality is not being called at
all ! Why so ?  I also has registered the function pointer as follows under
my class initialization function, 

*gstvideoencoder_class->pre_push = gst_myh264encoder_pre_push;*

Please help guys am so much stuck . Please I need help in this.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Please-help-to-understand-pre-push-functionality-in-GStVideoEncoderClass-tp4675723.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list