return factory_name;
}
+static void __videosink_caps_notify_cb(GstPad *pad, GParamSpec *unused, gpointer data)
+{
+ GstCaps *caps;
+ GstStructure *structure;
+ gint width = 0;
+ gint height = 0;
+ webrtc_gst_slot_s *sink = (webrtc_gst_slot_s *)data;
+
+ RET_IF(sink == NULL, "sink is NULL");
+
+ GET_CAPS_INFO_FROM_PAD(pad, caps);
+ structure = gst_caps_get_structure(caps, 0);
+
+ PRINT_CAPS(caps, "video sink pad");
+
+ gst_structure_get_int(structure, "width", &width);
+ gst_structure_get_int(structure, "height", &height);
+ LOG_INFO("width: %d, height: %d", width, height);
+
+ sink->video_info.width = width;
+ sink->video_info.height = height;
+
+ gst_caps_unref(caps);
+}
+
static int __build_videosink(webrtc_s *webrtc, GstElement *decodebin, GstPad *src_pad)
{
webrtc_gst_slot_s *sink;
GstElement *capsfilter;
GstElement *videosink;
GstElement *link_to;
+ GstPad *sink_pad;
const char *videosink_factory_name;
GList *element_list = NULL;
bool display_is_set;
if (display_is_set)
sink->display->sink_element = videosink;
+ sink_pad = gst_element_get_static_pad(link_to, "sink");
+ _connect_and_append_signal(&sink->signals, (GObject *)sink_pad, "notify::caps", G_CALLBACK(__videosink_caps_notify_cb), (gpointer)sink);
+ gst_object_unref(GST_OBJECT(sink_pad));
+
SAFE_G_LIST_FREE(element_list);
return WEBRTC_ERROR_NONE;