Bug 29532 - [GTK] media tests failing after their rework
Summary: [GTK] media tests failing after their rework
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2009-09-20 14:54 PDT by Gustavo Noronha (kov)
Modified: 2009-09-23 06:05 PDT (History)
2 users (show)

See Also:


Attachments
proposed fix (3.87 KB, patch)
2009-09-20 15:01 PDT, Gustavo Noronha (kov)
xan.lopez: review+
gustavo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2009-09-20 14:54:31 PDT
A Chromium developer reworked the tests to allow testing using formats/codecs that are supported. GStreamer supports the formats that are used in the tests, but doesn't correctly advertise them, so we started failing.
Comment 1 Gustavo Noronha (kov) 2009-09-20 15:01:07 PDT
Created attachment 39836 [details]
proposed fix
Comment 2 Philippe Normand 2009-09-21 01:09:21 PDT
GStreamer doesn't report the mime-types like the ones listed in
/etc/mime.types. The typefind functions (src ! typefind) report things like
content-type/container:

audio/mpeg

or video/x-msvideo for an avi file.

More data is probably available in the caps property of the typefind element.

So I'm not sure it's a good idea to have that mapping between Gstreamer formats
and WebKit. Would need to think more about it.
Comment 3 Xan Lopez 2009-09-21 02:20:43 PDT
(In reply to comment #2)
> GStreamer doesn't report the mime-types like the ones listed in
> /etc/mime.types. The typefind functions (src ! typefind) report things like
> content-type/container:
> 
> audio/mpeg
> 
> or video/x-msvideo for an avi file.
> 
> More data is probably available in the caps property of the typefind element.

Right, so gustavo's comment about gst failing to report things is not accurate.

> 
> So I'm not sure it's a good idea to have that mapping between Gstreamer formats
> and WebKit. Would need to think more about it.

Keep in mind that it's the HTML5 standard that says we should work with mime types, so this is not really up to debate (unless you convince the HTML5 guys we shouldn't use mime types). See: http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
Comment 4 Gustavo Noronha (kov) 2009-09-21 07:09:35 PDT
(In reply to comment #2)
> GStreamer doesn't report the mime-types like the ones listed in
> /etc/mime.types. The typefind functions (src ! typefind) report things like
> content-type/container:
> 
> audio/mpeg

Right. But we are given the mime type as defined in HTML5 to find out if we do support it or not, so we need some kind of mapping here.

> or video/x-msvideo for an avi file.
> 
> More data is probably available in the caps property of the typefind element.

We are using data from caps to get what we do now. Any suggestions on how we could improve this to correctly say we support video/mp4, audio/mp3, and the others?
Comment 5 Gustavo Noronha (kov) 2009-09-21 07:43:45 PDT
Some discussoin down at #gstreamer:

<slomo> kov: you need a MIME type <-> caps conversion and then you could check the registry
<slomo> or what everybody else said before ;)
<bilboed-pi> even then, it's not guaranteed
<__tim> we should add an FAQ entry for this somewhere ;)
<kov> __tim, I did look for that in the FAQ ;D
<bilboed-pi> i.e. MIME-TYPE : video/x-asf => neat, I have an asfdemux, all good => but you fail because you don't have the decoders
<ensonic> yes, if you don't find elements, then it won't play, but the opposite doe not have to be tru automatically
<kov> bilboed-pi, right, but I may also have the codec names
 does that help somehow?
 such as: type: video/ogg, codec: speex
 sorry, audio/ogg, speex
<bilboed-pi> you'd have to do a mapping table
 between your application's type system and gstreamer caps
<kov> bilboed-pi, sounds like a plan
<bilboed-pi> there are corner cases where it will fail though... because that codec description isn't verbose enough
<kov> I have made a quick try to see if I could get the tests working: https://bugs.webkit.org/attachment.cgi?id=39836&action=review
 I guess I'll have to play with that quite a bit more =)
<bilboed-pi> mp3 => audio/mpeg, mpegversion=1, layer=3
 wav is tricky
 it's a container format
 which, agreed, is mostly used for raw pcm... but can contain mp3 or other codecs
<kov> I guess we can handle corner cases as we find them
 if we get 80% coverage I'll be happy
Comment 6 Philippe Normand 2009-09-22 04:54:30 PDT
About last part of the patch, mapping audio/mpeg to audio/mp3 mime-type, what about mp1 and mp2 ?
Comment 7 Gustavo Noronha (kov) 2009-09-23 04:47:30 PDT
(In reply to comment #6)
> About last part of the patch, mapping audio/mpeg to audio/mp3 mime-type, what
> about mp1 and mp2 ?

I'll fix that =). We will need a quite big mapping. I am inclined to write it on demand like I did with those, and in the near future refactor it into a separate file, so that we can easily use the same code in other projects.
Comment 8 Xan Lopez 2009-09-23 04:55:43 PDT
Comment on attachment 39836 [details]
proposed fix

Let's get this for now and improve it gradually :)

r=me
Comment 9 Gustavo Noronha (kov) 2009-09-23 06:05:08 PDT
Landed as r48671, thanks!