mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
rtpbasepayload: Store ptime from caps
https://bugzilla.gnome.org/show_bug.cgi?id=606050
This commit is contained in:
parent
21151ba940
commit
a4b0f2a1bd
2 changed files with 12 additions and 3 deletions
|
@ -530,6 +530,7 @@ gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload, gchar * fieldname,
|
|||
}
|
||||
|
||||
payload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
||||
payload->abidata.ABI.ptime = 0;
|
||||
|
||||
/* the peer caps can override some of the defaults */
|
||||
peercaps = gst_pad_peer_get_caps (payload->srcpad);
|
||||
|
@ -547,7 +548,7 @@ gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload, gchar * fieldname,
|
|||
GstStructure *s, *d;
|
||||
const GValue *value;
|
||||
gint pt;
|
||||
guint max_ptime;
|
||||
gint max_ptime, ptime;
|
||||
|
||||
/* peer provides caps we can use to fixate, intersect. This always returns a
|
||||
* writable caps. */
|
||||
|
@ -561,9 +562,12 @@ gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload, gchar * fieldname,
|
|||
/* get first structure */
|
||||
s = gst_caps_get_structure (temp, 0);
|
||||
|
||||
if (gst_structure_get_uint (s, "maxptime", &max_ptime))
|
||||
if (gst_structure_get_int (s, "maxptime", &max_ptime) && max_ptime > 0)
|
||||
payload->priv->caps_max_ptime = max_ptime * GST_MSECOND;
|
||||
|
||||
if (gst_structure_get_int (s, "ptime", &ptime) && ptime > 0)
|
||||
payload->abidata.ABI.ptime = ptime;
|
||||
|
||||
if (gst_structure_get_int (s, "payload", &pt)) {
|
||||
/* use peer pt */
|
||||
GST_BASE_RTP_PAYLOAD_PT (payload) = pt;
|
||||
|
|
|
@ -111,7 +111,12 @@ struct _GstBaseRTPPayload
|
|||
/*< private >*/
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING - (sizeof(guint64)/sizeof(gpointer)) - 1];
|
||||
union {
|
||||
struct {
|
||||
guint ptime; /* in ms */
|
||||
} ABI;
|
||||
gpointer _gst_reserved[GST_PADDING - (sizeof(guint64)/sizeof(gpointer)) - 1];
|
||||
} abidata;
|
||||
};
|
||||
|
||||
struct _GstBaseRTPPayloadClass
|
||||
|
|
Loading…
Reference in a new issue