demux->common.src = NULL;
}
- if (demux->global_tags) {
- gst_tag_list_free (demux->global_tags);
- demux->global_tags = NULL;
+ if (demux->common.global_tags) {
+ gst_tag_list_free (demux->common.global_tags);
+ demux->common.global_tags = NULL;
}
g_object_unref (demux->common.adapter);
demux->writing_app = NULL;
demux->muxing_app = NULL;
demux->common.index = NULL;
- demux->global_tags = NULL;
+ demux->common.global_tags = NULL;
demux->common.adapter = gst_adapter_new ();
}
demux->common.element_index_writer_id = -1;
- if (demux->global_tags) {
- gst_tag_list_free (demux->global_tags);
+ if (demux->common.global_tags) {
+ gst_tag_list_free (demux->common.global_tags);
}
- demux->global_tags = gst_tag_list_new ();
+ demux->common.global_tags = gst_tag_list_new ();
if (demux->common.cached_buffer) {
gst_buffer_unref (demux->common.cached_buffer);
return ret;
}
-/* takes ownership of taglist */
-static void
-gst_matroska_demux_found_global_tag (GstMatroskaDemux * demux,
- GstTagList * taglist)
-{
- if (demux->global_tags) {
- /* nothing sent yet, add to cache */
- gst_tag_list_insert (demux->global_tags, taglist, GST_TAG_MERGE_APPEND);
- gst_tag_list_free (taglist);
- } else {
- /* hm, already sent, no need to cache and wait anymore */
- GST_DEBUG_OBJECT (demux, "Sending late global tags %" GST_PTR_FORMAT,
- taglist);
- gst_element_found_tags (GST_ELEMENT (demux), taglist);
- }
-}
-
/* returns FALSE if there are no pads to deliver event to,
* otherwise TRUE (whatever the outcome of event sending),
* takes ownership of the passed event! */
}
}
- if (G_UNLIKELY (is_newsegment && demux->global_tags != NULL)) {
- gst_tag_list_add (demux->global_tags, GST_TAG_MERGE_REPLACE,
+ if (G_UNLIKELY (is_newsegment && demux->common.global_tags != NULL)) {
+ gst_tag_list_add (demux->common.global_tags, GST_TAG_MERGE_REPLACE,
GST_TAG_CONTAINER_FORMAT, "Matroska", NULL);
GST_DEBUG_OBJECT (demux, "Sending global_tags %p : %" GST_PTR_FORMAT,
- demux->global_tags, demux->global_tags);
- gst_element_found_tags (GST_ELEMENT (demux), demux->global_tags);
- demux->global_tags = NULL;
+ demux->common.global_tags, demux->common.global_tags);
+ gst_element_found_tags (GST_ELEMENT (demux), demux->common.global_tags);
+ demux->common.global_tags = NULL;
}
gst_event_unref (event);
taglist = gst_tag_list_new ();
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, text,
NULL);
- gst_matroska_demux_found_global_tag (demux, taglist);
+ gst_matroska_read_common_found_global_tag (&demux->common,
+ GST_ELEMENT_CAST (demux), taglist);
g_free (text);
break;
}
DEBUG_ELEMENT_STOP (demux, ebml, "Tags", ret);
- gst_matroska_demux_found_global_tag (demux, taglist);
+ gst_matroska_read_common_found_global_tag (&demux->common,
+ GST_ELEMENT_CAST (demux), taglist);
return ret;
}
if (gst_structure_n_fields (GST_STRUCTURE (taglist)) > 0) {
GST_DEBUG_OBJECT (demux, "Storing attachment tags");
- gst_matroska_demux_found_global_tag (demux, taglist);
+ gst_matroska_read_common_found_global_tag (&demux->common,
+ GST_ELEMENT_CAST (demux), taglist);
} else {
GST_DEBUG_OBJECT (demux, "No valid attachments found");
gst_tag_list_free (taglist);
GstEvent *close_segment;
GstEvent *new_segment;
- GstTagList *global_tags;
/* some state saving */
GstClockTime cluster_time;
parse->common.src = NULL;
}
- if (parse->global_tags) {
- gst_tag_list_free (parse->global_tags);
- parse->global_tags = NULL;
+ if (parse->common.global_tags) {
+ gst_tag_list_free (parse->common.global_tags);
+ parse->common.global_tags = NULL;
}
g_object_unref (parse->common.adapter);
parse->writing_app = NULL;
parse->muxing_app = NULL;
parse->common.index = NULL;
- parse->global_tags = NULL;
+ parse->common.global_tags = NULL;
parse->common.adapter = gst_adapter_new ();
}
parse->common.element_index_writer_id = -1;
- if (parse->global_tags) {
- gst_tag_list_free (parse->global_tags);
+ if (parse->common.global_tags) {
+ gst_tag_list_free (parse->common.global_tags);
}
- parse->global_tags = gst_tag_list_new ();
+ parse->common.global_tags = gst_tag_list_new ();
if (parse->common.cached_buffer) {
gst_buffer_unref (parse->common.cached_buffer);
return ret;
}
-/* takes ownership of taglist */
-static void
-gst_matroska_parse_found_global_tag (GstMatroskaParse * parse,
- GstTagList * taglist)
-{
- if (parse->global_tags) {
- /* nothing sent yet, add to cache */
- gst_tag_list_insert (parse->global_tags, taglist, GST_TAG_MERGE_APPEND);
- gst_tag_list_free (taglist);
- } else {
- /* hm, already sent, no need to cache and wait anymore */
- GST_DEBUG_OBJECT (parse, "Sending late global tags %" GST_PTR_FORMAT,
- taglist);
- gst_element_found_tags (GST_ELEMENT (parse), taglist);
- }
-}
-
/* returns FALSE if there are no pads to deliver event to,
* otherwise TRUE (whatever the outcome of event sending),
* takes ownership of the passed event! */
taglist = gst_tag_list_new ();
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, text,
NULL);
- gst_matroska_parse_found_global_tag (parse, taglist);
+ gst_matroska_read_common_found_global_tag (&parse->common,
+ GST_ELEMENT_CAST (parse), taglist);
g_free (text);
break;
}
DEBUG_ELEMENT_STOP (parse, ebml, "Tags", ret);
- gst_matroska_parse_found_global_tag (parse, taglist);
+ gst_matroska_read_common_found_global_tag (&parse->common,
+ GST_ELEMENT_CAST (parse), taglist);
return ret;
}
if (gst_structure_n_fields (GST_STRUCTURE (taglist)) > 0) {
GST_DEBUG_OBJECT (parse, "Storing attachment tags");
- gst_matroska_parse_found_global_tag (parse, taglist);
+ gst_matroska_read_common_found_global_tag (&parse->common,
+ GST_ELEMENT_CAST (parse), taglist);
} else {
GST_DEBUG_OBJECT (parse, "No valid attachments found");
gst_tag_list_free (taglist);
GstEvent *close_segment;
GstEvent *new_segment;
- GstTagList *global_tags;
/* some state saving */
GstClockTime cluster_time;
return TRUE;
}
+/* takes ownership of taglist */
+void
+gst_matroska_read_common_found_global_tag (GstMatroskaReadCommon * common,
+ GstElement * el, GstTagList * taglist)
+{
+ if (common->global_tags) {
+ /* nothing sent yet, add to cache */
+ gst_tag_list_insert (common->global_tags, taglist, GST_TAG_MERGE_APPEND);
+ gst_tag_list_free (taglist);
+ } else {
+ /* hm, already sent, no need to cache and wait anymore */
+ GST_DEBUG_OBJECT (common, "Sending late global tags %" GST_PTR_FORMAT,
+ taglist);
+ gst_element_found_tags (el, taglist);
+ }
+}
+
gint64
gst_matroska_read_common_get_length (GstMatroskaReadCommon * common)
{
/* timescale in the file */
guint64 time_scale;
+ GstTagList *global_tags;
+
/* pull mode caching */
GstBuffer *cached_buffer;
GstMatroskaIndex * gst_matroska_read_common_do_index_seek (
GstMatroskaReadCommon * common, GstMatroskaTrackContext * track, gint64
seek_pos, GArray ** _index, gint * _entry_index);
+void gst_matroska_read_common_found_global_tag (GstMatroskaReadCommon * common,
+ GstElement * el, GstTagList * taglist);
gint64 gst_matroska_read_common_get_length (GstMatroskaReadCommon * common);
GstFlowReturn gst_matroska_read_common_parse_index (GstMatroskaReadCommon *
common, GstEbmlRead * ebml);