rtphdrext: Make write function return a signed value

Since the return value is documented to possibly be smaller than 0,
then it needs to be signed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1258>
This commit is contained in:
Olivier Crête 2021-08-18 19:40:55 -04:00 committed by GStreamer Marge Bot
parent 98f2a84a28
commit fd93c1ac19
5 changed files with 8 additions and 7 deletions

View file

@ -1641,7 +1641,7 @@ write_header_extension (GstRTPHeaderExtension * ext, gpointer user_data)
gsize remaining =
hdr->allocated_size - hdr->written_size - hdr->hdr_unit_size;
gsize offset = hdr->written_size + hdr->hdr_unit_size;
gsize written;
gssize written;
guint ext_id;
if (hdr->abort)

View file

@ -279,7 +279,7 @@ gst_rtp_header_extension_get_max_size (GstRTPHeaderExtension * ext,
*
* Since: 1.20
*/
gsize
gssize
gst_rtp_header_extension_write (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta, GstRTPHeaderExtensionFlags write_flags,
GstBuffer * output, guint8 * data, gsize size)

View file

@ -159,7 +159,7 @@ struct _GstRTPHeaderExtensionClass
gsize (*get_max_size) (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta);
gsize (*write) (GstRTPHeaderExtension * ext,
gssize (*write) (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta,
GstRTPHeaderExtensionFlags write_flags,
GstBuffer * output,
@ -210,7 +210,7 @@ GST_RTP_API
void gst_rtp_header_extension_set_id (GstRTPHeaderExtension * ext,
guint ext_id);
GST_RTP_API
gsize gst_rtp_header_extension_write (GstRTPHeaderExtension * ext,
gssize gst_rtp_header_extension_write (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta,
GstRTPHeaderExtensionFlags write_flags,
GstBuffer * output,

View file

@ -74,7 +74,7 @@ static GstRTPHeaderExtensionFlags
gst_rtp_dummy_hdr_ext_get_supported_flags (GstRTPHeaderExtension * ext);
static gsize gst_rtp_dummy_hdr_ext_get_max_size (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta);
static gsize gst_rtp_dummy_hdr_ext_write (GstRTPHeaderExtension * ext,
static gssize gst_rtp_dummy_hdr_ext_write (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta, GstRTPHeaderExtensionFlags write_flags,
GstBuffer * output, guint8 * data, gsize size);
static gboolean gst_rtp_dummy_hdr_ext_read (GstRTPHeaderExtension * ext,
@ -168,7 +168,7 @@ gst_rtp_dummy_hdr_ext_get_max_size (GstRTPHeaderExtension * ext,
#define TEST_DATA_BYTE 0x9d
static gsize
static gssize
gst_rtp_dummy_hdr_ext_write (GstRTPHeaderExtension * ext,
const GstBuffer * input_meta, GstRTPHeaderExtensionFlags write_flags,
GstBuffer * output, guint8 * data, gsize size)

View file

@ -35,7 +35,8 @@ GST_START_TEST (rtp_header_ext_write)
GstRTPHeaderExtension *dummy;
GstBuffer *buffer;
guint8 *data;
gsize size, written;
gsize size;
gssize written;
dummy = rtp_dummy_hdr_ext_new ();
gst_rtp_header_extension_set_id (dummy, 1);