GstStateChange transition)
{
GstTensorQueryServerSink *sink = GST_TENSOR_QUERY_SERVERSINK (element);
+ GstBaseSink *bsink = GST_BASE_SINK (element);
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+ GstCaps *caps;
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
gst_tensor_query_server_release_edge_handle (sink->sink_id);
break;
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+ caps = gst_pad_peer_query_caps (GST_BASE_SINK_PAD (bsink), NULL);
+ gst_tensor_query_serversink_set_caps(bsink, caps);
+ break;
default:
break;
}
static void gst_tensor_query_serversrc_finalize (GObject * object);
static GstFlowReturn gst_tensor_query_serversrc_create (GstPushSrc * psrc,
GstBuffer ** buf);
+static gboolean gst_tensor_query_serversrc_set_caps (GstBaseSrc * bsrc,
+ GstCaps * caps);
/**
* @brief initialize the query_serversrc class
GstStateChange transition)
{
GstTensorQueryServerSrc *src = GST_TENSOR_QUERY_SERVERSRC (element);
+ GstBaseSrc *bsrc = GST_BASE_SRC (element);
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+ GstCaps *caps;
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_tensor_query_server_remove_data (src->src_id);
break;
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+ caps = gst_pad_peer_query_caps (GST_BASE_SRC_PAD (bsrc), NULL);
+ gst_tensor_query_serversrc_set_caps (bsrc, caps);
+ break;
default:
break;
}
GstState state = GST_STATE_NULL;
if (!src->configured) {
- gchar *caps_str, *new_caps_str;
-
GstCaps *caps = gst_pad_peer_query_caps (GST_BASE_SRC_PAD (bsrc), NULL);
if (gst_caps_is_fixed (caps)) {
gst_base_src_set_caps (bsrc, caps);
}
- caps_str = gst_caps_to_string (caps);
-
- new_caps_str = g_strdup_printf ("@query_server_src_caps@%s", caps_str);
- gst_tensor_query_server_set_caps (src->src_id, new_caps_str);
- g_free (new_caps_str);
- g_free (caps_str);
+ gst_tensor_query_serversrc_set_caps (bsrc, caps);
gst_caps_unref (caps);
src->configured = TRUE;
return GST_FLOW_OK;
}
+
+/**
+ * @brief An implementation of the set_caps vmethod in GstBaseSrcClass
+ */
+static gboolean
+gst_tensor_query_serversrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
+{
+ GstTensorQueryServerSrc *src = GST_TENSOR_QUERY_SERVERSRC (bsrc);
+ gchar *caps_str, *new_caps_str;
+
+ caps_str = gst_caps_to_string (caps);
+
+ new_caps_str = g_strdup_printf ("@query_server_src_caps@%s", caps_str);
+ gst_tensor_query_server_set_caps (src->src_id, new_caps_str);
+
+ g_free (new_caps_str);
+ g_free (caps_str);
+
+ return TRUE;
+}