{
GstRTSPStreamPrivate *priv;
GstStructure *stats;
+ GObjectClass *payobjclass;
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE);
priv = stream->priv;
+ payobjclass = G_OBJECT_GET_CLASS (priv->payloader);
+
g_mutex_lock (&priv->lock);
- g_object_get (priv->payloader, "stats", &stats, NULL);
+ if (g_object_class_find_property (payobjclass, "stats")) {
+ g_object_get (priv->payloader, "stats", &stats, NULL);
+ if (stats == NULL)
+ goto no_stats;
+
+ if (seq)
+ gst_structure_get_uint (stats, "seqnum", seq);
- if (stats == NULL)
- goto no_stats;
+ if (rtptime)
+ gst_structure_get_uint (stats, "timestamp", rtptime);
- if (seq)
- gst_structure_get_uint (stats, "seqnum", seq);
+ if (running_time)
+ gst_structure_get_clock_time (stats, "running-time", running_time);
- if (rtptime)
- gst_structure_get_uint (stats, "timestamp", rtptime);
+ if (clock_rate) {
+ gst_structure_get_uint (stats, "clock-rate", clock_rate);
+ if (*clock_rate == 0 && running_time)
+ *running_time = GST_CLOCK_TIME_NONE;
+ }
+ gst_structure_free (stats);
+ } else {
+ if (!g_object_class_find_property (payobjclass, "seqnum") ||
+ !g_object_class_find_property (payobjclass, "timestamp"))
+ goto no_stats;
- if (running_time)
- gst_structure_get_clock_time (stats, "running-time", running_time);
+ g_object_get (priv->payloader, "seqnum", seq, "timestamp", rtptime, NULL);
- if (clock_rate) {
- gst_structure_get_uint (stats, "clock-rate", clock_rate);
- if (*clock_rate == 0 && running_time)
+ if (running_time)
*running_time = GST_CLOCK_TIME_NONE;
}
-
- gst_structure_free (stats);
-
g_mutex_unlock (&priv->lock);
return TRUE;