GNOME Bugzilla – Bug 619103
WebM demuxer
Last modified: 2010-05-20 14:18:55 UTC
Created attachment 161468 [details] changes RELEASE-0.10.22..RELEASE-0.10.22+VP8 http://www.webmproject.org/ Opera's WebM/VP8 support is based on GStreamer. Here are the patches. See also branch RELEASE-0.10.22+VP8 from git://sourcecode.opera.com/gstreamer/gst-plugins-good.git Merging that branch would be less work than applying the patches manually. Even if you don't like every line of code, it would be appreciated if you can take the patches as they are and then apply fixes/reverts on top of that. This would greatly simplify our later rebasing. After taking this patch, you may want to look at getting the "GStreamer: Coming Soon" part of http://www.webmproject.org/tools/ fixed. It's not obvious that vp8 belongs in -good, but it made sense it's useless without matroskademux, which is in -good. The branch mixes different fixes for vp8 and matroska, if you don't like this let me know and I'll file separate bugs. I will provide the test input for the crash fixes, I know these are a bit odd and the fixes may not be correct beyond avoiding crashes. Note that the autoconf magic for vp8 is missing, it is currently always enabled and assuming that libvpx is checked out and built on the same directory level as gst-plugins-good itself. libvpx doesn't have shared libraries or pkg-config yet, so this is a temporary solution. About vp8enc. The 2-pass support is a bit odd and I know that there is an odd bug where the last stats packets will sometimes not arrive. Probably a race condition. Also, there's a mismatch in what memory alignment GStreamer and libvpx assumes for the chroma planes. There's a temporary fix for libvpx in git://sourcecode.opera.com/gstreamer/libvpx.git, commit 5b73026d813396fd883d5f14d896eb8ae6efccb9. I'm working to fix this in a better way upstream. The problem will be apparent for sizes where the chroma channel width isn't a multiple of 2, i.e. the with of the video isn't a multiple of 4. Since the patches are so many, they are tarballed.
Ok, I've merged the matroska patches now. I'll merge things from the vp8 encoder/decoder plugin to gst-plugins-bad later... commit 9c59da8601dc23f43eb7e5fc91eb1670abff06cf Author: Philip <philipj@opera.com> Date: Tue May 18 21:04:32 2010 +0800 ebmlread: rm floatcast.h include (not used) commit cbde9467680c84f52424efa44df3b3e322653065 Author: Philip Jägenstedt <philipj@opera.com> Date: Mon May 17 05:36:00 2010 +0200 matroskamux: bump default doctype version to 2 In this day and age this should be safe. There's otherwise a risk people will be creating unneccessarily big WebM files as they can't use SimpleBlock in v1. commit 9610c7f354541c360be44c524454e55f162c9884 Author: Philip Jägenstedt <philipj@opera.com> Date: Mon May 17 05:27:44 2010 +0200 matroska: handle matroska and webm doctype versions equally The original plan was to let WebM v1 be the same as Matroska v2 (with extra constraints), but for simplicity it was decided to handle the versions equally, such that e.g. SimpleBlock is only allowed in WebM v2. commit 081f2d00aa7fb243e53c2343ecbe8def31c53a0c Author: Philip Jägenstedt <philipj@opera.com> Date: Thu May 13 12:10:54 2010 +0200 matroskademux: Verify lace size in _parse_blockgroup_or_simpleblock Failure to do this for corrupt input can cause a subbuffer bigger than the actual buffer to be created, quickly leading to segfault. Test case: bug_s222005751_r0.001____memcpy.webm commit c659c92091e5ae10baaf3e66f5caf7ddc6d34f0d Author: Philip Jägenstedt <philipj@opera.com> Date: Thu May 13 10:23:10 2010 +0200 ebml: crude hack to avoid crashing on unexpected metadata The comment says this cannot happen, but it did and I don't know why. This is not the correct fix, needs investigation. Test case: bug_s555010094_r0.0005:0.008____IA__g_assertion_message_expr.webm commit 9c1267b1a92068914cbf9cab9db48107797f1588 Author: Philip Jägenstedt <philipj@opera.com> Date: Thu May 13 09:18:56 2010 +0200 ebml: don't modify out str if returning an error in _read_ascii This is a regression from ASCII validation changes. Test case: bug_s66876390_r0.001____malloc_printerr.webm commit c712d2879655ecf0e503e06cd32eb058ef1af047 Author: Philip Jägenstedt <philipj@opera.com> Date: Wed May 12 13:16:28 2010 +0200 ebml: Validate 7-bit ASCII in gst_ebml_read_ascii This was triggering an UTF-8 assertion in gst_caps_set_simple for corrupt files with garbage as codec id. Test case: gstreamer_error_trying_to_set_invalid_utf8_as_codec_id.webm Old gst_ebml_read_ascii renamed to gst_ebml_read_string, also used by gst_ebml_read_utf8. Unlike for UTF-8, failure to validate is an error, as gst_ebml_read_ascii is used for reading doctype and codec id and we might just as well give up early in those cases. commit d14697112864f385e0a341cde6533f9e22d04c36 Author: Philip Jägenstedt <philipj@opera.com> Date: Wed May 12 14:30:18 2010 +0200 matroskademux: Ignore unexpected CodecState Because GstMatroskaTrackContext *stream is set up in the first SimpleBlock or Block, a rogue CodecState otherwise causes a segfault on derefencing the NULL pointer. Test case: bug_s5506167_r0.001____gst_matroska_demux_parse_blockgroup_or_simpleblock.we commit 9dc7889eea8420151f3eb24f6169d195200c5c21 Author: Philip Jägenstedt <philipj@opera.com> Date: Mon May 10 06:00:49 2010 +0200 matroskademux: Add video/webm sink caps commit ad05dfc032edb13afdb0281ae417fd99153ccb2e Author: Philip Jägenstedt <philip@foolip.org> Date: Sun May 9 19:46:51 2010 +0200 matroskamux: Use SimpleBlock for WebM when possible commit 1daeb26df1fd9d7d737a3229d65a92825499fd5a Author: Philip Jägenstedt <philip@foolip.org> Date: Sun May 9 19:28:59 2010 +0200 matroskademux: Support "webm" DocType commit 3b4759de189a26969a33f6e37020800b6efb3572 Author: Philip Jägenstedt <philip@foolip.org> Date: Sun May 9 12:35:10 2010 +0200 matroskamux: rename matroska_version to doctype_version commit 27069088db8f06e4019033f05b0fbba77082e2f4 Author: Philip Jägenstedt <philip@foolip.org> Date: Sun May 9 12:09:57 2010 +0200 matroskamux: Support "webm" DocType
Ok, let's close this bug. All non-decoder/encoder patches have been merged and the merging for them will take place in gst-plugins-bad anyway.