mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 09:08:14 +00:00
mpegts: add multilingual bouquet name descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=728429
This commit is contained in:
parent
b4cc5a2177
commit
cac329a621
3 changed files with 75 additions and 0 deletions
|
@ -330,6 +330,9 @@ gst_mpegts_descriptor_parse_dvb_bouquet_name
|
|||
<SUBSECTION multilingual_network_name>
|
||||
GstMpegTsDvbMultilingualNetworkNameItem
|
||||
gst_mpegts_descriptor_parse_dvb_multilingual_network_name
|
||||
<SUBSECTION multilingual_bouquet_name>
|
||||
GstMpegTsDvbMultilingualBouquetNameItem
|
||||
gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name
|
||||
<SUBSECTION Standard>
|
||||
GST_TYPE_MPEG_TSDVB_CODE_RATE
|
||||
gst_mpegts_dvb_code_rate_get_type
|
||||
|
|
|
@ -1434,6 +1434,59 @@ gst_mpegts_descriptor_parse_dvb_multilingual_network_name (const
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME (0x5C) */
|
||||
static void
|
||||
_gst_mpegts_dvb_multilingual_bouquet_name_item_free
|
||||
(GstMpegTsDvbMultilingualBouquetNameItem * item)
|
||||
{
|
||||
g_slice_free (GstMpegTsDvbMultilingualBouquetNameItem, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name:
|
||||
* @descriptor: a %GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME
|
||||
* #GstMpegTsDescriptor
|
||||
* @bouquet_name_items: (out) (element-type GstMpegTsDvbMultilingualBouquetNameItem):
|
||||
* a #GstMpegTsDvbMultilingualBouquetNameItem
|
||||
*
|
||||
* Parses out the multilingual bouquet name from the @descriptor.
|
||||
*
|
||||
* Returns: %TRUE if the parsing happened correctly, else %FALSE.
|
||||
*/
|
||||
gboolean
|
||||
gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name (const
|
||||
GstMpegTsDescriptor * descriptor, GPtrArray ** bouquet_name_items)
|
||||
{
|
||||
guint8 *data, i, len;
|
||||
GstMpegTsDvbMultilingualBouquetNameItem *item;
|
||||
|
||||
g_return_val_if_fail (descriptor != NULL && bouquet_name_items != NULL,
|
||||
FALSE);
|
||||
__common_desc_checks (descriptor, GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME,
|
||||
5, FALSE);
|
||||
|
||||
data = (guint8 *) descriptor->data + 2;
|
||||
|
||||
*bouquet_name_items = g_ptr_array_new_with_free_func ((GDestroyNotify)
|
||||
_gst_mpegts_dvb_multilingual_bouquet_name_item_free);
|
||||
|
||||
for (i = 0; i < descriptor->length - 3;) {
|
||||
item = g_slice_new0 (GstMpegTsDvbMultilingualBouquetNameItem);
|
||||
g_ptr_array_add (*bouquet_name_items, item);
|
||||
memcpy (data, item->language_code, 3);
|
||||
data += 3;
|
||||
i += 3;
|
||||
|
||||
len = *data;
|
||||
item->bouquet_name =
|
||||
get_encoding_and_convert ((const gchar *) data + 1, len);
|
||||
data += len + 1;
|
||||
i += len + 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */
|
||||
/**
|
||||
* gst_mpegts_descriptor_parse_dvb_private_data_specifier:
|
||||
|
|
|
@ -675,6 +675,25 @@ struct _GstMpegTsDvbMultilingualNetworkNameItem
|
|||
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_network_name (const GstMpegTsDescriptor
|
||||
*descriptor, GPtrArray ** network_name_items);
|
||||
|
||||
/* GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME (0x5C) */
|
||||
typedef struct _GstMpegTsDvbMultilingualBouquetNameItem GstMpegTsDvbMultilingualBouquetNameItem;
|
||||
|
||||
/**
|
||||
* GstMpegTsDvbMultilingualBouquetNameItem:
|
||||
* @language_code: the ISO 639 language code
|
||||
* @bouquet_name: the bouquet name
|
||||
*
|
||||
* a multilingual bouquet name entry
|
||||
*/
|
||||
struct _GstMpegTsDvbMultilingualBouquetNameItem
|
||||
{
|
||||
gchar language_code[3];
|
||||
gchar *bouquet_name;
|
||||
};
|
||||
|
||||
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name (const GstMpegTsDescriptor
|
||||
*descriptor, GPtrArray ** bouquet_name_items);
|
||||
|
||||
/* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */
|
||||
gboolean gst_mpegts_descriptor_parse_dvb_private_data_specifier (const GstMpegTsDescriptor
|
||||
* descriptor, guint32 * private_data_specifier, guint8 ** private_data,
|
||||
|
|
Loading…
Reference in a new issue