diff options
author | Edward Hervey <bilboed@bilboed.com> | 2014-07-01 10:03:05 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2014-07-01 10:03:49 +0200 |
commit | 8c53dfcfb6f7ebcc0438e7948d57d6d15090fd8b (patch) | |
tree | 163005657ca589943e23751ff75d656ee87c3860 /gst-libs/gst/mpegts | |
parent | 4cbddec9fe06008d61877e9864a8d724a2178eb4 (diff) | |
download | gstreamer-plugins-bad-8c53dfcfb6f7ebcc0438e7948d57d6d15090fd8b.tar.gz |
mpegts: Expose GstMpegtsDescriptor free function
Nothing earth shattering, but avoids people having to use g_boxed_free()
Diffstat (limited to 'gst-libs/gst/mpegts')
-rw-r--r-- | gst-libs/gst/mpegts/gst-dvb-section.c | 8 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gstmpegts-private.h | 1 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gstmpegtsdescriptor.c | 15 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gstmpegtsdescriptor.h | 2 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gstmpegtssection.c | 8 |
5 files changed, 22 insertions, 12 deletions
diff --git a/gst-libs/gst/mpegts/gst-dvb-section.c b/gst-libs/gst/mpegts/gst-dvb-section.c index 72b2f9053..03615b4e8 100644 --- a/gst-libs/gst/mpegts/gst-dvb-section.c +++ b/gst-libs/gst/mpegts/gst-dvb-section.c @@ -630,8 +630,8 @@ gst_mpegts_nit_new (void) nit = g_slice_new0 (GstMpegtsNIT); - nit->descriptors = - g_ptr_array_new_with_free_func ((GDestroyNotify) _free_descriptor); + nit->descriptors = g_ptr_array_new_with_free_func ((GDestroyNotify) + gst_mpegts_descriptor_free); nit->streams = g_ptr_array_new_with_free_func ((GDestroyNotify) _gst_mpegts_nit_stream_free); @@ -653,7 +653,7 @@ gst_mpegts_nit_stream_new (void) stream = g_slice_new0 (GstMpegtsNITStream); stream->descriptors = g_ptr_array_new_with_free_func ( - (GDestroyNotify) _free_descriptor); + (GDestroyNotify) gst_mpegts_descriptor_free); return stream; } @@ -979,7 +979,7 @@ gst_mpegts_sdt_service_new (void) service = g_slice_new0 (GstMpegtsSDTService); service->descriptors = g_ptr_array_new_with_free_func ((GDestroyNotify) - _free_descriptor); + gst_mpegts_descriptor_free); return service; } diff --git a/gst-libs/gst/mpegts/gstmpegts-private.h b/gst-libs/gst/mpegts/gstmpegts-private.h index 16a2cbdc4..5dcbe56ca 100644 --- a/gst-libs/gst/mpegts/gstmpegts-private.h +++ b/gst-libs/gst/mpegts/gstmpegts-private.h @@ -34,7 +34,6 @@ G_GNUC_INTERNAL guint32 _calc_crc32 (const guint8 *data, guint datalen); G_GNUC_INTERNAL gchar *get_encoding_and_convert (const gchar *text, guint length); G_GNUC_INTERNAL gchar *convert_lang_code (guint8 * data); G_GNUC_INTERNAL guint8 *dvb_text_from_utf8 (const gchar * text, gsize *out_size); -G_GNUC_INTERNAL void _free_descriptor (GstMpegtsDescriptor *descriptor); G_GNUC_INTERNAL GstMpegtsDescriptor *_new_descriptor (guint8 tag, guint8 length); G_GNUC_INTERNAL GstMpegtsDescriptor *_new_descriptor_with_extension (guint8 tag, guint8 tag_extension, guint8 length); diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c index 6490b73ae..44a4ef968 100644 --- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c +++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c @@ -715,15 +715,22 @@ _copy_descriptor (GstMpegtsDescriptor * desc) return copy; } +/** + * gst_mpegts_descriptor_free: + * @desc: The descriptor to free + * + * Frees @desc + */ void -_free_descriptor (GstMpegtsDescriptor * desc) +gst_mpegts_descriptor_free (GstMpegtsDescriptor * desc) { g_free ((gpointer) desc->data); g_slice_free (GstMpegtsDescriptor, desc); } G_DEFINE_BOXED_TYPE (GstMpegtsDescriptor, gst_mpegts_descriptor, - (GBoxedCopyFunc) _copy_descriptor, (GBoxedFreeFunc) _free_descriptor); + (GBoxedCopyFunc) _copy_descriptor, + (GBoxedFreeFunc) gst_mpegts_descriptor_free); /** * gst_mpegts_parse_descriptors: @@ -778,7 +785,9 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len) return NULL; } - res = g_ptr_array_new_full (nb_desc + 1, (GDestroyNotify) _free_descriptor); + res = + g_ptr_array_new_full (nb_desc + 1, + (GDestroyNotify) gst_mpegts_descriptor_free); data = buffer; diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.h b/gst-libs/gst/mpegts/gstmpegtsdescriptor.h index 5c6b1e175..698d442f1 100644 --- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.h +++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.h @@ -257,6 +257,8 @@ struct _GstMpegtsDescriptor guint8 *data; }; +void gst_mpegts_descriptor_free (GstMpegtsDescriptor *desc); + GPtrArray *gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len); const GstMpegtsDescriptor * gst_mpegts_find_descriptor (GPtrArray *descriptors, diff --git a/gst-libs/gst/mpegts/gstmpegtssection.c b/gst-libs/gst/mpegts/gstmpegtssection.c index 362d329cc..1006576dd 100644 --- a/gst-libs/gst/mpegts/gstmpegtssection.c +++ b/gst-libs/gst/mpegts/gstmpegtssection.c @@ -763,8 +763,8 @@ gst_mpegts_pmt_new (void) pmt = g_slice_new0 (GstMpegtsPMT); - pmt->descriptors = - g_ptr_array_new_with_free_func ((GDestroyNotify) _free_descriptor); + pmt->descriptors = g_ptr_array_new_with_free_func ((GDestroyNotify) + gst_mpegts_descriptor_free); pmt->streams = g_ptr_array_new_with_free_func ((GDestroyNotify) _gst_mpegts_pmt_stream_free); @@ -785,8 +785,8 @@ gst_mpegts_pmt_stream_new (void) stream = g_slice_new0 (GstMpegtsPMTStream); - stream->descriptors = - g_ptr_array_new_with_free_func ((GDestroyNotify) _free_descriptor); + stream->descriptors = g_ptr_array_new_with_free_func ((GDestroyNotify) + gst_mpegts_descriptor_free); return stream; } |