Last Comment Bug 777696 - Fix gstreamer backend on big endian architectures
: Fix gstreamer backend on big endian architectures
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: Trunk
: PowerPC OpenBSD
: -- normal (vote)
: mozilla17
Assigned To: Landry Breuil (:gaston)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 06:24 PDT by Landry Breuil (:gaston)
Modified: 2012-07-31 06:13 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
set endianness=4321 on BE archs (1.62 KB, patch)
2012-07-26 06:26 PDT, Landry Breuil (:gaston)
cajbir.bugzilla: review+
Details | Diff | Splinter Review

Description Landry Breuil (:gaston) 2012-07-26 06:24:23 PDT
As of now gstreamer backend hardcodes endianness here :
http://mxr.mozilla.org/mozilla-central/source/content/media/gstreamer/nsGStreamerReader.cpp#133

On OpenBSD/macppc (big endian) trying to load an mp4 vid it only shows the 'loading' throbber infinitely.

Patch in a few to 'fix' it (orthogonal to MOZ_SAMPLE_TYPE_FLOAT32 so a bit of ifdef dance..dunno if the int/48k/16/4321 case makes sense), might not be the best fix but with it i can view some samples on my ppc mac mini.
Comment 1 Landry Breuil (:gaston) 2012-07-26 06:26:40 PDT
Created attachment 646110 [details] [diff] [review]
set endianness=4321 on BE archs
Comment 2 Landry Breuil (:gaston) 2012-07-26 23:31:05 PDT
Alessandro, since this is your code, any comment before i push this commit ?
Comment 3 Alessandro Decina 2012-07-27 02:47:49 PDT
Looks good, although it can probably be simplified a bit by using G_BYTE_ORDER somehow.
Comment 4 Landry Breuil (:gaston) 2012-07-27 03:07:37 PDT
(In reply to Alessandro Decina from comment #3)
> Looks good, although it can probably be simplified a bit by using
> G_BYTE_ORDER somehow.

Right, but since it's a glib macro/#define i'm not sure we're allowed to use it, mxr (http://mxr.mozilla.org/mozilla-central/search?string=G_BYTE_ORDER) only shows an occurence in config/elf-dynstr-gc.c
Comment 5 Landry Breuil (:gaston) 2012-07-27 03:19:39 PDT
However, since gstreamer depends on glib we can safely use glib macros there.. i just need to figure out how to get the G_BYTE_ORDER #define properly replaced in the string passed to gst_parse_bin_from_description()
Comment 6 Landry Breuil (:gaston) 2012-07-27 03:32:30 PDT
Turns out it's not so simple without resorting to sprintf() games.. chris, any opinion/idea ? is it worth the effort ?
Comment 7 cajbir (:cajbir) 2012-07-29 16:03:02 PDT
(In reply to Landry Breuil (:gaston) from comment #6)
> Turns out it's not so simple without resorting to sprintf() games.. chris,
> any opinion/idea ? is it worth the effort ?

What you have is fine. We can revisit it with a later patch if you, or someone else, comes up with a better approach.
Comment 9 Ed Morley [:emorley] 2012-07-31 06:13:11 PDT
https://hg.mozilla.org/mozilla-central/rev/54a8f77d3d26

Note You need to log in before you can comment on or make changes to this bug.