mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
stream: also return the running-time
Return the running-time in the rtpinfo as well.
This commit is contained in:
parent
4ca0b23a3f
commit
cfdc7408b5
3 changed files with 17 additions and 13 deletions
|
@ -331,7 +331,7 @@ gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport * trans)
|
|||
|
||||
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;
|
||||
|
||||
rtpinfo = g_string_new ("");
|
||||
|
|
|
@ -1749,34 +1749,37 @@ was_not_joined:
|
|||
/**
|
||||
* gst_rtsp_stream_get_rtpinfo:
|
||||
* @stream: a #GstRTSPStream
|
||||
* @rtptime: result RTP timestamp
|
||||
* @seq: result RTP seqnum
|
||||
* @rtptime: (allow-none): result RTP timestamp
|
||||
* @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.
|
||||
*
|
||||
* Returns: %TRUE when rtptime and seq could be determined.
|
||||
* Returns: %TRUE when rtptime, seq and running-time could be determined.
|
||||
*/
|
||||
gboolean
|
||||
gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
|
||||
guint * rtptime, guint * seq)
|
||||
guint * rtptime, guint * seq, GstClockTime * running_time)
|
||||
{
|
||||
GstRTSPStreamPrivate *priv;
|
||||
GObjectClass *payobjclass;
|
||||
|
||||
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;
|
||||
|
||||
payobjclass = G_OBJECT_GET_CLASS (priv->payloader);
|
||||
|
||||
if (!g_object_class_find_property (payobjclass, "seqnum") ||
|
||||
!g_object_class_find_property (payobjclass, "timestamp"))
|
||||
return FALSE;
|
||||
if (seq && g_object_class_find_property (payobjclass, "seqnum"))
|
||||
g_object_get (priv->payloader, "seqnum", seq, NULL);
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,8 @@ void gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,
|
|||
guint *ssrc);
|
||||
|
||||
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);
|
||||
|
||||
GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream,
|
||||
|
|
Loading…
Reference in a new issue