stream: also return the running-time

Return the running-time in the rtpinfo as well.
This commit is contained in:
Wim Taymans 2013-12-26 14:43:35 +01:00
parent 4ca0b23a3f
commit cfdc7408b5
3 changed files with 17 additions and 13 deletions

View file

@ -331,7 +331,7 @@ gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport * trans)
priv = trans->priv; priv = trans->priv;
if (!gst_rtsp_stream_get_rtpinfo (priv->stream, &rtptime, &seq)) if (!gst_rtsp_stream_get_rtpinfo (priv->stream, &rtptime, &seq, NULL))
return NULL; return NULL;
rtpinfo = g_string_new (""); rtpinfo = g_string_new ("");

View file

@ -1749,34 +1749,37 @@ was_not_joined:
/** /**
* gst_rtsp_stream_get_rtpinfo: * gst_rtsp_stream_get_rtpinfo:
* @stream: a #GstRTSPStream * @stream: a #GstRTSPStream
* @rtptime: result RTP timestamp * @rtptime: (allow-none): result RTP timestamp
* @seq: result RTP seqnum * @seq: (allow-none): result RTP seqnum
* @running_time: (allow-none): result running-time
* *
* Retrieve the current rtptime and seq. This is used to * Retrieve the current rtptime, seq and running-time. This is used to
* construct a RTPInfo reply header. * construct a RTPInfo reply header.
* *
* Returns: %TRUE when rtptime and seq could be determined. * Returns: %TRUE when rtptime, seq and running-time could be determined.
*/ */
gboolean gboolean
gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream, gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
guint * rtptime, guint * seq) guint * rtptime, guint * seq, GstClockTime * running_time)
{ {
GstRTSPStreamPrivate *priv; GstRTSPStreamPrivate *priv;
GObjectClass *payobjclass; GObjectClass *payobjclass;
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE);
g_return_val_if_fail (rtptime != NULL, FALSE);
g_return_val_if_fail (seq != NULL, FALSE);
priv = stream->priv; priv = stream->priv;
payobjclass = G_OBJECT_GET_CLASS (priv->payloader); payobjclass = G_OBJECT_GET_CLASS (priv->payloader);
if (!g_object_class_find_property (payobjclass, "seqnum") || if (seq && g_object_class_find_property (payobjclass, "seqnum"))
!g_object_class_find_property (payobjclass, "timestamp")) g_object_get (priv->payloader, "seqnum", seq, NULL);
return FALSE;
g_object_get (priv->payloader, "seqnum", seq, "timestamp", rtptime, NULL); if (rtptime && g_object_class_find_property (payobjclass, "timestamp"))
g_object_get (priv->payloader, "timestamp", rtptime, NULL);
if (running_time
&& g_object_class_find_property (payobjclass, "running-time"))
g_object_get (priv->payloader, "running-time", running_time, NULL);
return TRUE; return TRUE;
} }

View file

@ -118,7 +118,8 @@ void gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,
guint *ssrc); guint *ssrc);
gboolean gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream, gboolean gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream,
guint *rtptime, guint *seq); guint *rtptime, guint *seq,
GstClockTime *running_time);
GstCaps * gst_rtsp_stream_get_caps (GstRTSPStream *stream); GstCaps * gst_rtsp_stream_get_caps (GstRTSPStream *stream);
GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream, GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream,