mpdparser: support multiple ProgramInformation nodes

now we keep a list of ProgramInformation nodes for each Period node
This commit is contained in:
Gianluca Gennari 2012-10-08 11:30:40 +02:00 committed by Thiago Santos
parent dd198bc86d
commit 416ea67979
2 changed files with 9 additions and 7 deletions

View file

@ -67,7 +67,7 @@ static void gst_mpdparser_parse_adaptation_set_node (GList ** list, xmlNode * a_
static void gst_mpdparser_parse_subset_node (GList ** list, xmlNode * a_node); static void gst_mpdparser_parse_subset_node (GList ** list, xmlNode * a_node);
static void gst_mpdparser_parse_segment_template_node (GstSegmentTemplateNode ** pointer, xmlNode * a_node); static void gst_mpdparser_parse_segment_template_node (GstSegmentTemplateNode ** pointer, xmlNode * a_node);
static void gst_mpdparser_parse_period_node (GList ** list, xmlNode * a_node); static void gst_mpdparser_parse_period_node (GList ** list, xmlNode * a_node);
static void gst_mpdparser_parse_program_info_node (GstProgramInformationNode ** pointer, xmlNode * a_node); static void gst_mpdparser_parse_program_info_node (GList ** list, xmlNode * a_node);
static void gst_mpdparser_parse_metrics_range_node (GList ** list, xmlNode * a_node); static void gst_mpdparser_parse_metrics_range_node (GList ** list, xmlNode * a_node);
static void gst_mpdparser_parse_metrics_node (GList ** list, xmlNode * a_node); static void gst_mpdparser_parse_metrics_node (GList ** list, xmlNode * a_node);
static void gst_mpdparser_parse_root_node (GstMpdClient * client, xmlNode *a_node); static void gst_mpdparser_parse_root_node (GstMpdClient * client, xmlNode *a_node);
@ -1388,17 +1388,17 @@ gst_mpdparser_parse_period_node (GList ** list, xmlNode * a_node)
} }
static void static void
gst_mpdparser_parse_program_info_node (GstProgramInformationNode ** pointer, xmlNode * a_node) gst_mpdparser_parse_program_info_node (GList ** list, xmlNode * a_node)
{ {
xmlNode *cur_node; xmlNode *cur_node;
GstProgramInformationNode *new_prog_info; GstProgramInformationNode *new_prog_info;
gst_mpdparser_free_prog_info_node (*pointer); new_prog_info = g_slice_new0 (GstProgramInformationNode);
*pointer = new_prog_info = g_slice_new0 (GstProgramInformationNode);
if (new_prog_info == NULL) { if (new_prog_info == NULL) {
GST_WARNING ("Allocation of ProgramInfo node failed!"); GST_WARNING ("Allocation of ProgramInfo node failed!");
return; return;
} }
*list = g_list_append (*list, new_prog_info);
GST_LOG ("attributes of ProgramInformation node:"); GST_LOG ("attributes of ProgramInformation node:");
new_prog_info->moreInformationURL = new_prog_info->moreInformationURL =
@ -1816,7 +1816,9 @@ gst_mpdparser_free_mpd_node (GstMPDNode * mpd_node)
gst_date_time_unref (mpd_node->availabilityStartTime); gst_date_time_unref (mpd_node->availabilityStartTime);
if (mpd_node->availabilityEndTime) if (mpd_node->availabilityEndTime)
gst_date_time_unref (mpd_node->availabilityEndTime); gst_date_time_unref (mpd_node->availabilityEndTime);
gst_mpdparser_free_prog_info_node (mpd_node->ProgramInfo); g_list_foreach (mpd_node->ProgramInfo,
(GFunc) gst_mpdparser_free_prog_info_node, NULL);
g_list_free (mpd_node->ProgramInfo);
g_list_foreach (mpd_node->BaseURLs, g_list_foreach (mpd_node->BaseURLs,
(GFunc) gst_mpdparser_free_base_url_node, NULL); (GFunc) gst_mpdparser_free_base_url_node, NULL);
g_list_free (mpd_node->BaseURLs); g_list_free (mpd_node->BaseURLs);

View file

@ -372,8 +372,8 @@ struct _GstMPDNode
GList *BaseURLs; GList *BaseURLs;
/* list of Location nodes */ /* list of Location nodes */
GList *Locations; GList *Locations;
/* ProgramInformation node */ /* List of ProgramInformation nodes */
GstProgramInformationNode *ProgramInfo; GList *ProgramInfo;
/* list of Periods nodes */ /* list of Periods nodes */
GList *Periods; GList *Periods;
/* list of Metrics nodes */ /* list of Metrics nodes */