Which gstreamer plug-in source code to reffer ?
ssshukla26
ssshukla26 at gmail.com
Sun Jan 17 03:38:31 PST 2016
Hi,
As you suggested I have done the following things, now it doesn't shows any
error but no output also !
1) I override *set_format* function as follows
static gboolean *gst_myencoder_set_format* (GstVideoEncoder *encoder,
GstVideoCodecState *state)
{
g_print("%s....................\n",__func__);
gst_video_encoder_set_output_state(encoder,gst_caps_new_empty_simple("video/x-raw"),state);
return TRUE;
}
2) Added finishing of the "encoded" frames in *handle_frame* function as
follows
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);
*
if(ret != GST_FLOW_EOS)
{
ret = gst_video_encoder_finish_frame (encoder,frame);
}
*
return ret;
}
By executing a pipeline as follows it doesn't show any error but I am not
getting any output on video sink.
*gst-plugin$ gst-launch-1.0 videotestsrc !
video/x-raw,width=640,height=480,framerate=30/1 ! myh264encoder ! videoparse
width=640 height=480 framerate=30/1 ! autovideoconvert ! 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 ...
gst_myencoder_set_format....................
gst_myencoder_handle_frame....................
gst_myencoder_handle_frame....................
gst_myencoder_handle_frame....................
.
.
.
gst_myencoder_handle_frame....................
^Chandling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
gst_myencoder_stop....................
gst_myencoder_close....................
Freeing pipeline ...
Please help me out to identify what am missing and what am doing wrong !
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Which-gstreamer-plug-in-source-code-to-reffer-tp4675203p4675309.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list