Commit 4a28e649 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

rtp: cache meta tag quarks and add more utility functions for metas

Every g_quark_from_static_string() is a hash table lookup serialised
on the global quark lock in GLib. Let's just look up the two quarks
we need once and cache them locally for future use. While we're at it,
add new utility functions for the two most commonly used tags
(audio + video). Make first argument a gpointer so we don't have to
cast and make the code ugly. These are used for logging purposes
only anyway.
parent 810c0bb0
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <gst/tag/tag.h> #include <gst/tag/tag.h>
#include "gstrtputils.h"
#include "gstrtpac3depay.h" #include "gstrtpac3depay.h"
#include "gstrtpac3pay.h" #include "gstrtpac3pay.h"
#include "gstrtpbvdepay.h" #include "gstrtpbvdepay.h"
...@@ -115,6 +117,11 @@ plugin_init (GstPlugin * plugin) ...@@ -115,6 +117,11 @@ plugin_init (GstPlugin * plugin)
{ {
gst_tag_image_type_get_type (); gst_tag_image_type_get_type ();
rtp_quark_meta_tag_video =
g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
rtp_quark_meta_tag_audio =
g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
if (!gst_rtp_ac3_depay_plugin_init (plugin)) if (!gst_rtp_ac3_depay_plugin_init (plugin))
return FALSE; return FALSE;
......
...@@ -258,8 +258,7 @@ gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -258,8 +258,7 @@ gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
goto reorder_failed; goto reorder_failed;
} }
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpL16depay), outbuf, gst_rtp_drop_non_audio_meta (rtpL16depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
return outbuf; return outbuf;
......
...@@ -230,8 +230,7 @@ gst_rtp_L24_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -230,8 +230,7 @@ gst_rtp_L24_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
outbuf = gst_buffer_make_writable (outbuf); outbuf = gst_buffer_make_writable (outbuf);
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpL24depay), outbuf, gst_rtp_drop_non_audio_meta (rtpL24depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
if (rtpL24depay->order && if (rtpL24depay->order &&
!gst_audio_buffer_reorder_channels (outbuf, !gst_audio_buffer_reorder_channels (outbuf,
......
...@@ -156,8 +156,7 @@ gst_rtp_ac3_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -156,8 +156,7 @@ gst_rtp_ac3_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 2, -1); outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 2, -1);
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpac3depay), outbuf, gst_rtp_drop_non_audio_meta (rtpac3depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
GST_DEBUG_OBJECT (rtpac3depay, "pushing buffer of size %" G_GSIZE_FORMAT, GST_DEBUG_OBJECT (rtpac3depay, "pushing buffer of size %" G_GSIZE_FORMAT,
gst_buffer_get_size (outbuf)); gst_buffer_get_size (outbuf));
} }
......
...@@ -323,8 +323,8 @@ gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay) ...@@ -323,8 +323,8 @@ gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay)
payload_buffer = payload_buffer =
gst_adapter_take_buffer_fast (rtpac3pay->adapter, payload_len); gst_adapter_take_buffer_fast (rtpac3pay->adapter, payload_len);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtpac3pay), outbuf, payload_buffer,
g_quark_from_static_string (GST_META_TAG_AUDIO_STR)); gst_rtp_copy_audio_meta (rtpac3pay, outbuf, payload_buffer);
outbuf = gst_buffer_append (outbuf, payload_buffer); outbuf = gst_buffer_append (outbuf, payload_buffer);
......
...@@ -427,8 +427,7 @@ gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -427,8 +427,7 @@ gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
GST_DEBUG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT, GST_DEBUG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT,
gst_buffer_get_size (outbuf)); gst_buffer_get_size (outbuf));
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtpamrdepay), outbuf, rtp->buffer, gst_rtp_copy_audio_meta (rtpamrdepay, outbuf, rtp->buffer);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
return outbuf; return outbuf;
......
...@@ -392,8 +392,7 @@ gst_rtp_amr_pay_handle_buffer (GstRTPBasePayload * basepayload, ...@@ -392,8 +392,7 @@ gst_rtp_amr_pay_handle_buffer (GstRTPBasePayload * basepayload,
gst_buffer_unmap (buffer, &map); gst_buffer_unmap (buffer, &map);
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtpamrpay), outbuf, buffer, gst_rtp_copy_audio_meta (rtpamrpay, outbuf, buffer);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
......
...@@ -176,8 +176,7 @@ gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -176,8 +176,7 @@ gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
} }
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), outbuf, gst_rtp_drop_non_audio_meta (depayload, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
return outbuf; return outbuf;
......
...@@ -260,8 +260,7 @@ gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -260,8 +260,7 @@ gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
GST_TIME_ARGS (GST_BUFFER_PTS (outbuf)), GST_TIME_ARGS (GST_BUFFER_PTS (outbuf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf))); GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), outbuf, gst_rtp_drop_non_audio_meta (depayload, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
gst_rtp_base_depayload_push (depayload, outbuf); gst_rtp_base_depayload_push (depayload, outbuf);
} }
......
...@@ -362,8 +362,7 @@ gst_rtp_celt_pay_flush_queued (GstRtpCELTPay * rtpceltpay) ...@@ -362,8 +362,7 @@ gst_rtp_celt_pay_flush_queued (GstRtpCELTPay * rtpceltpay)
gst_buffer_extract (buf, 0, payload, size); gst_buffer_extract (buf, 0, payload, size);
payload += size; payload += size;
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtpceltpay), outbuf, buf, gst_rtp_copy_audio_meta (rtpceltpay, outbuf, buf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
gst_buffer_unref (buf); gst_buffer_unref (buf);
} }
......
...@@ -240,8 +240,7 @@ gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -240,8 +240,7 @@ gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
} }
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpg722depay), outbuf, gst_rtp_drop_non_audio_meta (rtpg722depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
return outbuf; return outbuf;
......
...@@ -164,8 +164,7 @@ gst_rtp_g723_pay_flush (GstRTPG723Pay * pay) ...@@ -164,8 +164,7 @@ gst_rtp_g723_pay_flush (GstRTPG723Pay * pay)
pay->discont = FALSE; pay->discont = FALSE;
} }
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
gst_rtp_copy_meta (GST_ELEMENT_CAST (pay), outbuf, payload_buf, gst_rtp_copy_audio_meta (pay, outbuf, payload_buf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
outbuf = gst_buffer_append (outbuf, payload_buf); outbuf = gst_buffer_append (outbuf, payload_buf);
......
...@@ -228,8 +228,7 @@ gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -228,8 +228,7 @@ gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
outbuf = gst_rtp_buffer_get_payload_buffer (rtp); outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (!outbuf) if (!outbuf)
goto bad_len; goto bad_len;
gst_rtp_drop_meta (GST_ELEMENT_CAST (depay), outbuf, gst_rtp_drop_non_audio_meta (depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} else { } else {
guint8 *in, *out, tmp; guint8 *in, *out, tmp;
guint len; guint len;
...@@ -243,8 +242,7 @@ gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -243,8 +242,7 @@ gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
goto bad_len; goto bad_len;
outbuf = gst_buffer_make_writable (outbuf); outbuf = gst_buffer_make_writable (outbuf);
gst_rtp_drop_meta (GST_ELEMENT_CAST (depay), outbuf, gst_rtp_drop_non_audio_meta (depay, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
gst_buffer_map (outbuf, &map, GST_MAP_WRITE); gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
out = map.data; out = map.data;
......
...@@ -202,8 +202,7 @@ gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -202,8 +202,7 @@ gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC); GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
} }
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), outbuf, gst_rtp_drop_non_audio_meta (depayload, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
GST_LOG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT, GST_LOG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT,
gst_buffer_get_size (outbuf)); gst_buffer_get_size (outbuf));
......
...@@ -190,8 +190,7 @@ gst_rtp_g729_pay_push (GstRTPG729Pay * rtpg729pay, GstBuffer * buf) ...@@ -190,8 +190,7 @@ gst_rtp_g729_pay_push (GstRTPG729Pay * rtpg729pay, GstBuffer * buf)
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* append payload */ /* append payload */
gst_rtp_copy_meta (GST_ELEMENT_CAST (basepayload), outbuf, buf, gst_rtp_copy_audio_meta (basepayload, outbuf, buf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
outbuf = gst_buffer_append (outbuf, buf); outbuf = gst_buffer_append (outbuf, buf);
ret = gst_rtp_base_payload_push (basepayload, outbuf); ret = gst_rtp_base_payload_push (basepayload, outbuf);
......
...@@ -138,8 +138,7 @@ gst_rtp_gsm_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -138,8 +138,7 @@ gst_rtp_gsm_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
} }
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), outbuf, gst_rtp_drop_non_audio_meta (depayload, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
return outbuf; return outbuf;
......
...@@ -151,8 +151,7 @@ gst_rtp_gsm_pay_handle_buffer (GstRTPBasePayload * basepayload, ...@@ -151,8 +151,7 @@ gst_rtp_gsm_pay_handle_buffer (GstRTPBasePayload * basepayload,
GST_BUFFER_PTS (outbuf) = timestamp; GST_BUFFER_PTS (outbuf) = timestamp;
GST_BUFFER_DURATION (outbuf) = duration; GST_BUFFER_DURATION (outbuf) = duration;
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtpgsmpay), outbuf, buffer, gst_rtp_copy_audio_meta (rtpgsmpay, outbuf, buffer);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
/* append payload */ /* append payload */
outbuf = gst_buffer_append (outbuf, buffer); outbuf = gst_buffer_append (outbuf, buffer);
......
...@@ -170,8 +170,7 @@ skip: ...@@ -170,8 +170,7 @@ skip:
avail = gst_adapter_available (depay->adapter); avail = gst_adapter_available (depay->adapter);
outbuf = gst_adapter_take_buffer (depay->adapter, avail); outbuf = gst_adapter_take_buffer (depay->adapter, avail);
gst_rtp_drop_meta (GST_ELEMENT_CAST (depay), outbuf, gst_rtp_drop_non_video_meta (depay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
/* Note that the I flag does not mean intra frame, but that the entire /* Note that the I flag does not mean intra frame, but that the entire
* stream is intra coded. */ * stream is intra coded. */
......
...@@ -850,8 +850,7 @@ gst_rtp_h261_pay_fragment_push (GstRtpH261Pay * pay, GstBuffer * buffer, ...@@ -850,8 +850,7 @@ gst_rtp_h261_pay_fragment_push (GstRtpH261Pay * pay, GstBuffer * buffer,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
gst_rtp_copy_meta (GST_ELEMENT_CAST (pay), outbuf, buffer, gst_rtp_copy_video_meta (pay, outbuf, buffer);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
return gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD_CAST (pay), outbuf); return gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD_CAST (pay), outbuf);
} }
......
...@@ -387,8 +387,7 @@ skip: ...@@ -387,8 +387,7 @@ skip:
GST_DEBUG ("Pushing out a buffer of %d bytes", avail); GST_DEBUG ("Pushing out a buffer of %d bytes", avail);
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtph263depay), outbuf, gst_rtp_drop_non_video_meta (rtph263depay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
gst_rtp_base_depayload_push (depayload, outbuf); gst_rtp_base_depayload_push (depayload, outbuf);
rtph263depay->offset = 0; rtph263depay->offset = 0;
......
...@@ -1320,9 +1320,8 @@ gst_rtp_h263_pay_push (GstRtpH263Pay * rtph263pay, ...@@ -1320,9 +1320,8 @@ gst_rtp_h263_pay_push (GstRtpH263Pay * rtph263pay,
gst_buffer_copy_into (package->outbuf, rtph263pay->current_buffer, gst_buffer_copy_into (package->outbuf, rtph263pay->current_buffer,
GST_BUFFER_COPY_MEMORY, package->payload_start - rtph263pay->map.data, GST_BUFFER_COPY_MEMORY, package->payload_start - rtph263pay->map.data,
package->payload_len); package->payload_len);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph263pay), package->outbuf, gst_rtp_copy_video_meta (rtph263pay, package->outbuf,
rtph263pay->current_buffer, rtph263pay->current_buffer);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
ret = ret =
gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtph263pay), gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtph263pay),
......
...@@ -331,8 +331,7 @@ gst_rtp_h263p_depay_process (GstRTPBaseDepayload * depayload, ...@@ -331,8 +331,7 @@ gst_rtp_h263p_depay_process (GstRTPBaseDepayload * depayload,
outbuf = gst_buffer_append (outbuf, padbuf); outbuf = gst_buffer_append (outbuf, padbuf);
} }
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtph263pdepay), outbuf, gst_rtp_drop_non_video_meta (rtph263pdepay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
return outbuf; return outbuf;
} else { } else {
......
...@@ -753,8 +753,7 @@ gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay) ...@@ -753,8 +753,7 @@ gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay)
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
payload_buf = gst_adapter_take_buffer_fast (rtph263ppay->adapter, towrite); payload_buf = gst_adapter_take_buffer_fast (rtph263ppay->adapter, towrite);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph263ppay), outbuf, payload_buf, gst_rtp_copy_video_meta (rtph263ppay, outbuf, payload_buf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (outbuf, payload_buf); outbuf = gst_buffer_append (outbuf, payload_buf);
avail -= towrite; avail -= towrite;
......
...@@ -863,17 +863,14 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal, ...@@ -863,17 +863,14 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
/* prepend codec_data */ /* prepend codec_data */
if (rtph264depay->codec_data) { if (rtph264depay->codec_data) {
GST_DEBUG_OBJECT (depayload, "prepending codec_data"); GST_DEBUG_OBJECT (depayload, "prepending codec_data");
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264depay), gst_rtp_copy_video_meta (rtph264depay, rtph264depay->codec_data, outbuf);
rtph264depay->codec_data, outbuf,
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (rtph264depay->codec_data, outbuf); outbuf = gst_buffer_append (rtph264depay->codec_data, outbuf);
rtph264depay->codec_data = NULL; rtph264depay->codec_data = NULL;
out_keyframe = TRUE; out_keyframe = TRUE;
} }
outbuf = gst_buffer_make_writable (outbuf); outbuf = gst_buffer_make_writable (outbuf);
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtph264depay), outbuf, gst_rtp_drop_non_video_meta (rtph264depay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_BUFFER_PTS (outbuf) = out_timestamp; GST_BUFFER_PTS (outbuf) = out_timestamp;
...@@ -1046,8 +1043,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1046,8 +1043,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size); memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264depay), outbuf, gst_rtp_copy_video_meta (rtph264depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = outbuf =
gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp, gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp,
...@@ -1128,8 +1124,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1128,8 +1124,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
map.data[sizeof (sync_bytes)] = nal_header; map.data[sizeof (sync_bytes)] = nal_header;
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264depay), outbuf, gst_rtp_copy_video_meta (rtph264depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_DEBUG_OBJECT (rtph264depay, "queueing %d bytes", outsize); GST_DEBUG_OBJECT (rtph264depay, "queueing %d bytes", outsize);
...@@ -1144,8 +1139,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1144,8 +1139,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
outbuf = gst_buffer_new_and_alloc (outsize); outbuf = gst_buffer_new_and_alloc (outsize);
gst_buffer_fill (outbuf, 0, payload, outsize); gst_buffer_fill (outbuf, 0, payload, outsize);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264depay), outbuf, gst_rtp_copy_video_meta (rtph264depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_DEBUG_OBJECT (rtph264depay, "queueing %d bytes", outsize); GST_DEBUG_OBJECT (rtph264depay, "queueing %d bytes", outsize);
...@@ -1182,8 +1176,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1182,8 +1176,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size); memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264depay), outbuf, gst_rtp_copy_video_meta (rtph264depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp, outbuf = gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp,
marker); marker);
......
...@@ -891,8 +891,7 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload, ...@@ -891,8 +891,7 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* insert payload memory block */ /* insert payload memory block */
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264pay), outbuf, paybuf, gst_rtp_copy_video_meta (rtph264pay, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (outbuf, paybuf); outbuf = gst_buffer_append (outbuf, paybuf);
/* push the buffer to the next element */ /* push the buffer to the next element */
...@@ -952,8 +951,7 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload, ...@@ -952,8 +951,7 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* insert payload memory block */ /* insert payload memory block */
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph264pay), outbuf, paybuf, gst_rtp_copy_video_meta (rtph264pay, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos, gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos,
limitedSize); limitedSize);
......
...@@ -1026,17 +1026,14 @@ gst_rtp_h265_depay_handle_nal (GstRtpH265Depay * rtph265depay, GstBuffer * nal, ...@@ -1026,17 +1026,14 @@ gst_rtp_h265_depay_handle_nal (GstRtpH265Depay * rtph265depay, GstBuffer * nal,
/* prepend codec_data */ /* prepend codec_data */
if (rtph265depay->codec_data) { if (rtph265depay->codec_data) {
GST_DEBUG_OBJECT (depayload, "prepending codec_data"); GST_DEBUG_OBJECT (depayload, "prepending codec_data");
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265depay), gst_rtp_copy_video_meta (rtph265depay, rtph265depay->codec_data, outbuf);
rtph265depay->codec_data, outbuf,
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (rtph265depay->codec_data, outbuf); outbuf = gst_buffer_append (rtph265depay->codec_data, outbuf);
rtph265depay->codec_data = NULL; rtph265depay->codec_data = NULL;
out_keyframe = TRUE; out_keyframe = TRUE;
} }
outbuf = gst_buffer_make_writable (outbuf); outbuf = gst_buffer_make_writable (outbuf);
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtph265depay), outbuf, gst_rtp_drop_non_video_meta (rtph265depay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_BUFFER_PTS (outbuf) = out_timestamp; GST_BUFFER_PTS (outbuf) = out_timestamp;
...@@ -1241,8 +1238,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1241,8 +1238,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size); memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265depay), outbuf, gst_rtp_copy_video_meta (rtph265depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = outbuf =
gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp, gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp,
...@@ -1338,8 +1334,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1338,8 +1334,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
map.data[sizeof (sync_bytes) + 1] = nal_header & 0xff; map.data[sizeof (sync_bytes) + 1] = nal_header & 0xff;
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265depay), outbuf, gst_rtp_copy_video_meta (rtph265depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_DEBUG_OBJECT (rtph265depay, "queueing %d bytes", outsize); GST_DEBUG_OBJECT (rtph265depay, "queueing %d bytes", outsize);
...@@ -1358,8 +1353,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1358,8 +1353,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
outbuf = gst_buffer_new_and_alloc (outsize); outbuf = gst_buffer_new_and_alloc (outsize);
gst_buffer_fill (outbuf, 0, payload, outsize); gst_buffer_fill (outbuf, 0, payload, outsize);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265depay), outbuf, gst_rtp_copy_video_meta (rtph265depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_DEBUG_OBJECT (rtph265depay, "queueing %d bytes", outsize); GST_DEBUG_OBJECT (rtph265depay, "queueing %d bytes", outsize);
...@@ -1404,8 +1398,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -1404,8 +1398,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size); memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265depay), outbuf, gst_rtp_copy_video_meta (rtph265depay, outbuf, rtp->buffer);
rtp->buffer, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp, outbuf = gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp,
marker); marker);
......
...@@ -1001,8 +1001,7 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload, ...@@ -1001,8 +1001,7 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
GST_BUFFER_DTS (outbuf) = dts; GST_BUFFER_DTS (outbuf) = dts;
/* insert payload memory block */ /* insert payload memory block */
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265pay), outbuf, paybuf, gst_rtp_copy_video_meta (rtph265pay, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (outbuf, paybuf); outbuf = gst_buffer_append (outbuf, paybuf);
outlist = gst_buffer_list_new (); outlist = gst_buffer_list_new ();
...@@ -1072,8 +1071,7 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload, ...@@ -1072,8 +1071,7 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* insert payload memory block */ /* insert payload memory block */
gst_rtp_copy_meta (GST_ELEMENT_CAST (rtph265pay), outbuf, paybuf, gst_rtp_copy_video_meta (rtph265pay, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos, gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos,
limitedSize); limitedSize);
/* add the buffer to the buffer list */ /* add the buffer to the buffer list */
......
...@@ -191,8 +191,7 @@ gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -191,8 +191,7 @@ gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
} }
if (outbuf) { if (outbuf) {
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), outbuf, gst_rtp_drop_non_audio_meta (depayload, outbuf);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
} }
return outbuf; return outbuf;
......
...@@ -431,8 +431,7 @@ gst_rtp_j2k_depay_flush_frame (GstRTPBaseDepayload * depayload) ...@@ -431,8 +431,7 @@ gst_rtp_j2k_depay_flush_frame (GstRTPBaseDepayload * depayload)
GST_DEBUG_OBJECT (rtpj2kdepay, "pushing buffer of %u bytes", avail); GST_DEBUG_OBJECT (rtpj2kdepay, "pushing buffer of %u bytes", avail);
outbuf = gst_adapter_take_buffer (rtpj2kdepay->f_adapter, avail); outbuf = gst_adapter_take_buffer (rtpj2kdepay->f_adapter, avail);
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), gst_rtp_drop_non_video_meta (depayload, outbuf);
outbuf, g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
ret = gst_rtp_base_depayload_push (depayload, outbuf); ret = gst_rtp_base_depayload_push (depayload, outbuf);
} else { } else {
GST_WARNING_OBJECT (rtpj2kdepay, "empty packet"); GST_WARNING_OBJECT (rtpj2kdepay, "empty packet");
......
...@@ -506,8 +506,7 @@ gst_rtp_j2k_pay_handle_buffer (GstRTPBasePayload * basepayload, ...@@ -506,8 +506,7 @@ gst_rtp_j2k_pay_handle_buffer (GstRTPBasePayload * basepayload,
/* make subbuffer of j2k data */ /* make subbuffer of j2k data */
paybuf = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, paybuf = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL,
offset, data_size); offset, data_size);
gst_rtp_copy_meta (GST_ELEMENT_CAST (basepayload), outbuf, paybuf, gst_rtp_copy_video_meta (basepayload, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (outbuf, paybuf); outbuf = gst_buffer_append (outbuf, paybuf);
gst_buffer_list_add (list, outbuf); gst_buffer_list_add (list, outbuf);
......
...@@ -721,8 +721,7 @@ gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -721,8 +721,7 @@ gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
rtpjpegdepay->discont = FALSE; rtpjpegdepay->discont = FALSE;
} }
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpjpegdepay), outbuf, gst_rtp_drop_non_video_meta (rtpjpegdepay, outbuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
GST_DEBUG_OBJECT (rtpjpegdepay, "returning %u bytes", avail); GST_DEBUG_OBJECT (rtpjpegdepay, "returning %u bytes", avail);
} }
......
...@@ -895,8 +895,7 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload, ...@@ -895,8 +895,7 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
jpeg_header_size + offset, payload_size); jpeg_header_size + offset, payload_size);
/* join memory parts */ /* join memory parts */
gst_rtp_copy_meta (GST_ELEMENT_CAST (pay), outbuf, paybuf, gst_rtp_copy_video_meta (pay, outbuf, paybuf);
g_quark_from_static_string (GST_META_TAG_VIDEO_STR));
outbuf = gst_buffer_append (outbuf, paybuf); outbuf = gst_buffer_append (outbuf, paybuf);
GST_BUFFER_PTS (outbuf) = timestamp; GST_BUFFER_PTS (outbuf) = timestamp;
......
...@@ -394,8 +394,7 @@ gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) ...@@ -394,8 +394,7 @@ gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
avail -= skip; avail -= skip;
GST_BUFFER_PTS (tmp) = timestamp; GST_BUFFER_PTS (tmp) = timestamp;
gst_rtp_drop_meta (GST_ELEMENT_CAST (depayload), tmp, gst_rtp_drop_non_audio_meta (depayload, tmp);
g_quark_from_static_string (GST_META_TAG_AUDIO_STR));
gst_rtp_base_depayload_push (depayload, tmp); gst_rtp_base_depayload_push (depayload, tmp);
/* shift ts for next buffers */ /* shift ts for next buffers */
......