mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
rtp: rtpbasedepayload: simplify code
Remove unnecessary helper struct for callbacks. The bclass member of the helper struct was not used, so we can just remove it and the GET_CLASS() call and simplify the whole affair by passing the depayloader directly to the callback.
This commit is contained in:
parent
c1d55f29a1
commit
a80c546628
1 changed files with 3 additions and 15 deletions
|
@ -742,16 +742,9 @@ create_segment_event (GstRTPBaseDepayload * filter, guint rtptime,
|
|||
return event;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GstRTPBaseDepayload *depayload;
|
||||
GstRTPBaseDepayloadClass *bclass;
|
||||
} HeaderData;
|
||||
|
||||
static gboolean
|
||||
set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
||||
set_headers (GstBuffer ** buffer, guint idx, GstRTPBaseDepayload * depayload)
|
||||
{
|
||||
GstRTPBaseDepayload *depayload = data->depayload;
|
||||
GstRTPBaseDepayloadPrivate *priv = depayload->priv;
|
||||
GstClockTime pts, dts, duration;
|
||||
|
||||
|
@ -788,17 +781,12 @@ static GstFlowReturn
|
|||
gst_rtp_base_depayload_prepare_push (GstRTPBaseDepayload * filter,
|
||||
gboolean is_list, gpointer obj)
|
||||
{
|
||||
HeaderData data;
|
||||
|
||||
data.depayload = filter;
|
||||
data.bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
|
||||
|
||||
if (is_list) {
|
||||
GstBufferList **blist = obj;
|
||||
gst_buffer_list_foreach (*blist, (GstBufferListFunc) set_headers, &data);
|
||||
gst_buffer_list_foreach (*blist, (GstBufferListFunc) set_headers, filter);
|
||||
} else {
|
||||
GstBuffer **buf = obj;
|
||||
set_headers (buf, 0, &data);
|
||||
set_headers (buf, 0, filter);
|
||||
}
|
||||
|
||||
/* if this is the first buffer send a NEWSEGMENT */
|
||||
|
|
Loading…
Reference in a new issue