gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTsDescriptor *
descriptor, gchar ** name)
{
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x40, FALSE);
+ g_return_val_if_fail (descriptor != NULL && name != NULL, FALSE);
/* We need at least one byte of data for the string */
- g_return_val_if_fail (descriptor->length >= 1, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_NETWORK_NAME, 1, FALSE);
*name = get_encoding_and_convert ((gchar *) descriptor->data + 2,
descriptor->data[1]);
guint8 *data;
guint8 tmp;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x43, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* This descriptor is always 11 bytes long */
- g_return_val_if_fail (descriptor->length == 11, FALSE);
+ __common_desc_checks_exact (descriptor,
+ GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM, 11, FALSE);
data = (guint8 *) descriptor->data + 2;
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x44, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* This descriptor is always 11 bytes long */
- g_return_val_if_fail (descriptor->length == 11, FALSE);
+ __common_desc_checks_exact (descriptor,
+ GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM, 11, FALSE);
data = (guint8 *) descriptor->data + 2;
/* BCD in MHz, decimal place after the fourth character */
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x48, FALSE);
+ g_return_val_if_fail (descriptor != NULL, FALSE);
/* Need at least 3 bytes (type and 2 bytes for the string length) */
- g_return_val_if_fail (descriptor->length >= 3, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SERVICE, 3, FALSE);
data = (guint8 *) descriptor->data + 2;
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x4D, FALSE);
+ g_return_val_if_fail (descriptor != NULL, FALSE);
/* Need at least 5 bytes (3 for language code, 2 for each string length) */
- g_return_val_if_fail (descriptor->length >= 5, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SHORT_EVENT, 5, FALSE);
data = (guint8 *) descriptor->data + 2;
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_TELETEXT, FALSE);
+ g_return_val_if_fail (descriptor != NULL, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_TELETEXT, 0, FALSE);
if (descriptor->length / 5 <= idx)
return FALSE;
gst_mpegts_descriptor_parse_dvb_teletext_nb (const GstMpegTsDescriptor *
descriptor)
{
- if (descriptor == NULL || descriptor->data == NULL)
- return 0;
+ g_return_val_if_fail (descriptor != NULL, 0);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_TELETEXT, 0, 0);
return descriptor->length / 5;
}
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (lang != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_SUBTITLING, FALSE);
+ g_return_val_if_fail (descriptor != NULL && lang != NULL, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SUBTITLING, 0, FALSE);
/* If we went too far, return FALSE */
if (descriptor->length / 8 <= idx)
gst_mpegts_descriptor_parse_dvb_subtitling_nb (const GstMpegTsDescriptor *
descriptor)
{
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, 0);
+ g_return_val_if_fail (descriptor != NULL, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SUBTITLING, 0, FALSE);
return descriptor->length / 8;
}
guint8 tmp, len_item;
GstMpegTsExtendedEventItem *item;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_EXTENDED_EVENT,
- FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* Need at least 6 bytes (1 for desc number, 3 for language code, 2 for the loop length) */
- g_return_val_if_fail (descriptor->length >= 6, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_EXTENDED_EVENT, 6, FALSE);
data = (guint8 *) descriptor->data + 2;
guint8 *data;
guint8 len;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_COMPONENT, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* Need 6 bytes at least (1 for content, 1 for type, 1 for tag, 3 for language code) */
- g_return_val_if_fail (descriptor->length >= 6, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_COMPONENT, 6, FALSE);
data = (guint8 *) descriptor->data + 2;
guint8 *data;
guint8 len, tmp;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_CONTENT, FALSE);
+ g_return_val_if_fail (descriptor != NULL && content != NULL, FALSE);
+ __common_desc_checks (descriptor, GST_MTS_DESC_DVB_CONTENT, 0, FALSE);
data = (guint8 *) descriptor->data + 2;
len = descriptor->length;
/* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */
/**
* gst_mpegts_descriptor_parse_dvb_terrestrial_delivary_system:
- * @descriptor: a %GST_MTS_DESC_DVB_CONTENT #GstMpegTsDescriptor
+ * @descriptor: a %GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM #GstMpegTsDescriptor
* @res: (out) (transfer none): #GstMpegTsTerrestrialSystemDescriptor
*
* Parses out the terrestrial delivery system from the @descriptor:
guint8 *data;
guint8 tmp;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x5a, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* Descriptor is always 11 bytes long */
- g_return_val_if_fail (descriptor->length == 11, FALSE);
+ __common_desc_checks_exact (descriptor,
+ GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM, 11, FALSE);
data = (guint8 *) descriptor->data + 2;
guint i;
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (res != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x0A, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* This descriptor can be empty, no size check needed */
+ __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE);
data = (guint8 *) descriptor->data + 2;
/* Each language is 3 + 1 bytes */
{
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (lang != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_ISO_639_LANGUAGE,
- FALSE);
+ g_return_val_if_fail (descriptor != NULL && lang != NULL, FALSE);
+ /* This descriptor can be empty, no size check needed */
+ __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE);
if (descriptor->length / 4 <= idx)
return FALSE;
gst_mpegts_descriptor_parse_iso_639_language_nb (const GstMpegTsDescriptor *
descriptor)
{
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, 0);
+ g_return_val_if_fail (descriptor != NULL, 0);
+ /* This descriptor can be empty, no size check needed */
+ __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE);
return descriptor->length / 4;
}
guint i;
guint8 *data;
- g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
- g_return_val_if_fail (descriptor->tag == 0x83, FALSE);
+ g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE);
/* This descriptor loop can be empty, no size check required */
+ __common_desc_checks (descriptor, GST_MTS_DESC_DTG_LOGICAL_CHANNEL, 0, FALSE);
data = (guint8 *) descriptor->data;
res->nb_channels = descriptor->length / 4;