After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775965 - ttmlparse: Collect buffers until detecting complete xml document
ttmlparse: Collect buffers until detecting complete xml document
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-12 01:52 UTC by Seungha Yang
Modified: 2018-11-03 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ttmlparse: Collect buffers until detecting complete xml document (2.06 KB, patch)
2016-12-12 01:55 UTC, Seungha Yang
none Details | Review
ttmlrender: Fix segfault on _render_text_region() (1.61 KB, patch)
2016-12-12 01:56 UTC, Seungha Yang
committed Details | Review
ttmlparse: Collect buffers until detecting complete xml document (5.89 KB, patch)
2018-07-20 12:38 UTC, Seungha Yang
none Details | Review

Description Seungha Yang 2016-12-12 01:52:55 UTC
Pushed buffer from upstream element might be fragmented
Comment 1 Seungha Yang 2016-12-12 01:55:32 UTC
Created attachment 341788 [details] [review]
ttmlparse: Collect buffers until detecting complete xml document
Comment 2 Seungha Yang 2016-12-12 01:56:00 UTC
Created attachment 341789 [details] [review]
ttmlrender: Fix segfault on _render_text_region()

Fix invalid memory access
Comment 3 Seungha Yang 2016-12-12 01:56:34 UTC
Problem can be reproduced with
gst-play-1.0 http://dash.akamaized.net/dash264/TestCases/4b/qualcomm/3/Solekai.mpd
Comment 4 Sebastian Dröge (slomo) 2016-12-12 08:59:53 UTC
Review of attachment 341788 [details] [review]:

::: ext/ttml/gstttmlparse.c
@@ +438,3 @@
+        G_GSIZE_FORMAT, avail);
+    return;
+  }

Instead of trying to parse the document every time (which is expensive), it would be better to just check the starting and closing XML tag. Especially that would then also work if you get *multiple* documents in a single buffer (in which case you would have to split).
Comment 5 Sebastian Dröge (slomo) 2016-12-12 09:01:04 UTC
Comment on attachment 341789 [details] [review]
ttmlrender: Fix segfault on _render_text_region()

Attachment 341789 [details] pushed as a5ce16f - ttmlrender: Fix segfault on _render_text_region()
Comment 6 Seungha Yang 2016-12-12 11:03:33 UTC
(In reply to Sebastian Dröge (slomo) from comment #4)
> Review of attachment 341788 [details] [review] [review]:

What do you think about converting baseclass of ttmlparse to baseparse?, is it too bulky? (currently just gstelement is used)
Comment 7 Sebastian Dröge (slomo) 2016-12-12 11:12:14 UTC
Is that going to make anything easier? In general, sure... but I'm not sure how well baseparse fits for how ttmlparse works.
Comment 8 Seungha Yang 2016-12-12 12:48:44 UTC
(In reply to Sebastian Dröge (slomo) from comment #7)
> Is that going to make anything easier? In general, sure... but I'm not sure
> how well baseparse fits for how ttmlparse works.

converting baseclass to baseparse seems to be reasonable to me.

- Because nobody guarantee that input buffers are complete xml document, make use of basepasrse's buffer gathering logic can make the code simple, I think.
- One feature of ttml is xml document can be demuxed (?) into multiple buffer, but it also be covered by baseparse's API. 
- One left tricky thing is setting PTS on buffer based on input buffer's PTS and duration, but it's a challenge for both current ttmlparse based and baseparse based.

I'll take a look at the structure more.
Comment 9 Seungha Yang 2018-07-20 12:38:50 UTC
Created attachment 373106 [details] [review]
ttmlparse: Collect buffers until detecting complete xml document

Given buffer could be fragmented and we might need to
collect buffers until end tag is detected. And/or, a buffer
can consist of multiple ttml documents.
Comment 10 Seungha Yang 2018-07-20 12:40:48 UTC
(In reply to Sebastian Dröge (slomo) from comment #7)
> Is that going to make anything easier? In general, sure... but I'm not sure
> how well baseparse fits for how ttmlparse works.

I found that subparse also just gstelement based (not baseparse based). So I changed my mind :)
Comment 11 GStreamer system administrator 2018-11-03 14:01:38 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/494.