mpegts: use getter for egde linkage descriptor type

https://bugzilla.gnome.org/show_bug.cgi?id=730914
This commit is contained in:
Stefan Ringel 2014-07-04 14:04:47 +02:00 committed by Edward Hervey
parent dc1eeec7df
commit 43dd0ec62a
4 changed files with 68 additions and 7 deletions

View file

@ -309,6 +309,9 @@ GstMpegtsDVBLinkageEvent
GstMpegtsDVBLinkageExtendedEvent GstMpegtsDVBLinkageExtendedEvent
GstMpegtsDVBLinkageDescriptor GstMpegtsDVBLinkageDescriptor
gst_mpegts_dvb_linkage_descriptor_free gst_mpegts_dvb_linkage_descriptor_free
gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over
gst_mpegts_dvb_linkage_descriptor_get_event
gst_mpegts_dvb_linkage_descriptor_get_extended_event
gst_mpegts_descriptor_parse_dvb_linkage gst_mpegts_descriptor_parse_dvb_linkage
<SUBSECTION private_data_specifier> <SUBSECTION private_data_specifier>
gst_mpegts_descriptor_parse_dvb_private_data_specifier gst_mpegts_descriptor_parse_dvb_private_data_specifier

View file

@ -770,6 +770,57 @@ fail:
return FALSE; return FALSE;
} }
/**
* gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over:
* @desc: the #GstMpegtsDVBLinkageDescriptor
*
* Returns: The #GstMpegtsDVBLinkageMobileHandOver or %NULL if an error happened
*/
const GstMpegtsDVBLinkageMobileHandOver *
gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over (const
GstMpegtsDVBLinkageDescriptor * desc)
{
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->linkage_type ==
GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER, NULL);
return (const GstMpegtsDVBLinkageMobileHandOver *) desc->linkage_data;
}
/**
* gst_mpegts_dvb_linkage_descriptor_get_event:
* @desc: the #GstMpegtsDVBLinkageDescriptor
*
* Returns: The #GstMpegtsDVBLinkageEvent or %NULL if an error happened
*/
const GstMpegtsDVBLinkageEvent *
gst_mpegts_dvb_linkage_descriptor_get_event (const GstMpegtsDVBLinkageDescriptor
* desc)
{
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->linkage_type ==
GST_MPEGTS_DVB_LINKAGE_EVENT, NULL);
return (const GstMpegtsDVBLinkageEvent *) desc->linkage_data;
}
/**
* gst_mpegts_dvb_linkage_descriptor_get_extended_event:
* @desc: the #GstMpegtsDVBLinkageDescriptor
*
* Returns: (element-type GstMpegtsDVBLinkageExtendedEvent): an #GstMpegtsDVBLinkageExtendedEvent array or %NULL if an error happened
*/
const GPtrArray *
gst_mpegts_dvb_linkage_descriptor_get_extended_event (const
GstMpegtsDVBLinkageDescriptor * desc)
{
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->linkage_type ==
GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT, NULL);
return (const GPtrArray *) desc->linkage_data;
}
/* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */ /* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */
/** /**
* gst_mpegts_descriptor_parse_dvb_short_event: * gst_mpegts_descriptor_parse_dvb_short_event:

View file

@ -434,7 +434,6 @@ struct _GstMpegtsDVBLinkageExtendedEvent
* @original_network_id: the original network id * @original_network_id: the original network id
* @service_id: the service id * @service_id: the service id
* @linkage_type: the type which %linkage_data has * @linkage_type: the type which %linkage_data has
* @linkage_data: the linkage structure depending from %linkage_type
* @private_data_length: the length for %private_data_bytes * @private_data_length: the length for %private_data_bytes
* @private_data_bytes: additional data bytes * @private_data_bytes: additional data bytes
*/ */
@ -444,7 +443,9 @@ struct _GstMpegtsDVBLinkageDescriptor
guint16 original_network_id; guint16 original_network_id;
guint16 service_id; guint16 service_id;
GstMpegtsDVBLinkageType linkage_type; GstMpegtsDVBLinkageType linkage_type;
/*< private >*/
gpointer linkage_data; gpointer linkage_data;
/*< public >*/
guint8 private_data_length; guint8 private_data_length;
guint8 *private_data_bytes; guint8 *private_data_bytes;
}; };
@ -454,7 +455,12 @@ struct _GstMpegtsDVBLinkageDescriptor
GType gst_mpegts_dvb_linkage_descriptor_get_type (void); GType gst_mpegts_dvb_linkage_descriptor_get_type (void);
void gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source); void gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source);
const GstMpegtsDVBLinkageMobileHandOver * gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over
(const GstMpegtsDVBLinkageDescriptor * desc);
const GstMpegtsDVBLinkageEvent * gst_mpegts_dvb_linkage_descriptor_get_event
(const GstMpegtsDVBLinkageDescriptor * desc);
const GPtrArray * gst_mpegts_dvb_linkage_descriptor_get_extended_event
(const GstMpegtsDVBLinkageDescriptor * desc);
gboolean gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor, gboolean gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
GstMpegtsDVBLinkageDescriptor ** res); GstMpegtsDVBLinkageDescriptor ** res);

View file

@ -328,8 +328,8 @@ dump_linkage (GstMpegtsDescriptor * desc, guint spacing)
switch (res->linkage_type) { switch (res->linkage_type) {
case GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER: case GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER:
{ {
GstMpegtsDVBLinkageMobileHandOver *linkage = const GstMpegtsDVBLinkageMobileHandOver *linkage =
(GstMpegtsDVBLinkageMobileHandOver *) res->linkage_data; gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over (res);
g_printf ("%*s hand_over_type : 0x%02x (%s)\n", spacing, g_printf ("%*s hand_over_type : 0x%02x (%s)\n", spacing,
"", linkage->hand_over_type, "", linkage->hand_over_type,
enum_name (GST_TYPE_MPEGTS_DVB_LINKAGE_HAND_OVER_TYPE, enum_name (GST_TYPE_MPEGTS_DVB_LINKAGE_HAND_OVER_TYPE,
@ -344,8 +344,8 @@ dump_linkage (GstMpegtsDescriptor * desc, guint spacing)
} }
case GST_MPEGTS_DVB_LINKAGE_EVENT: case GST_MPEGTS_DVB_LINKAGE_EVENT:
{ {
GstMpegtsDVBLinkageEvent *linkage = const GstMpegtsDVBLinkageEvent *linkage =
(GstMpegtsDVBLinkageEvent *) res->linkage_data; gst_mpegts_dvb_linkage_descriptor_get_event (res);
g_printf ("%*s target_event_id : 0x%04x\n", spacing, "", g_printf ("%*s target_event_id : 0x%04x\n", spacing, "",
linkage->target_event_id); linkage->target_event_id);
g_printf ("%*s target_listed : %s\n", spacing, "", g_printf ("%*s target_listed : %s\n", spacing, "",
@ -357,7 +357,8 @@ dump_linkage (GstMpegtsDescriptor * desc, guint spacing)
case GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT: case GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT:
{ {
guint i; guint i;
GPtrArray *items = (GPtrArray *) res->linkage_data; const GPtrArray *items =
gst_mpegts_dvb_linkage_descriptor_get_extended_event (res);
for (i = 0; i < items->len; i++) { for (i = 0; i < items->len; i++) {
GstMpegtsDVBLinkageExtendedEvent *linkage = GstMpegtsDVBLinkageExtendedEvent *linkage =