How to parse current capabilities of a pad in a plugin?
ssshukla26
ssshukla26 at gmail.com
Thu Jan 28 02:44:13 PST 2016
As you suggested, I did the following inside my *::set_format* function
static gboolean *gst_myencoder_set_format* (GstVideoEncoder *encoder,
GstVideoCodecState *state)
{
g_print("%s....................\n",__func__);
*GstStructure *structure = gst_caps_get_structure (state->caps, 0);
gchar *width = gst_value_serialize
(gst_structure_get_value(structure,"width"));
gchar *height = gst_value_serialize
(gst_structure_get_value(structure,"height"));
gchar *framerate = gst_value_serialize
(gst_structure_get_value(structure,"framerate"));
g_print("Width = %s, Height = %s, Framerate =
%s\n",width,height,framerate);
g_free(width);
g_free(height);
g_free(framerate);*
gst_video_encoder_set_output_state(encoder,gst_caps_new_empty_simple
("video/x-h264"),state);
return TRUE;
}
And it worked.
But after all what the use of it ? This function is called after ::open()
and ::start() function of GstVideoEncoder base class.
I want this "*video/x-raw,format=I420,width=640,height=480,framerate=30/1*"
information before my encoder is initialized in *open* and *start* function.
Else things won't work for me. Can you please suggest a way out ?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-parse-current-capabilities-of-a-pad-in-a-plugin-tp4675536p4675544.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list