[theora-dev] Theora on iPhone

Ralph Giles giles at xiph.org
Tue Oct 7 12:59:44 PDT 2008


On Tue, Oct 7, 2008 at 12:56 PM, Steven Woolley <woobert at gmail.com> wrote:

> I posted a while back "complaining" about lack of a theora player on the
> iPhone.  Porting the code for libtheora (and libogg/libvorbis) was
> (relatively) painless, and appears to be working.

Awesome!

> The SDL port to iphone uses an opengl-es driver and opengl drivers for SDL
> don't support YUV overlay's!

Oops.

> a) convert from YUV to RGB in code (this probably won't work for realtime
> decoding)

There's code for this in a lot of places.
http://svn.annodex.net/liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb.c
is one example. Does the iphone's arm have an mmx unit?

> b) convert from YUV to RGB using pixel shading (If it sounds like I don't
> know what I'm talking about, that's correct... I've simply seen smarter
> people talk about doing the conversion on the GPU using pixel shading???)

If you can do this with opengl-es and get gpu accelleration, this is
the way to go. Then backport your code to the sdl port so everyone
else can use it. I don't know how to do this, but there are lots of
examples. You could try asking macslow for help if you get stuck; he's
done a lot opengl media player work.

> c) convert the frames to still images in a format that the iphone can
> display natively (doesn't jpeg use the same YUV encoding that theora does?)
> and render them as a series of images (I have no clue if this is feasible or
> not, or if the conversion/decoding would be worse than just doing a or b
> above)

You could use the same pixel format, but you'd still have to encode
each frame, so this isn't going to be a realtime option either. And
static image display pipelines often aren't fast enough for video.

> On a negative note, the guy that ported vlc to iphone (google vlc4iphone)
> hasn't released any of the source... so I can't even cheat to see how he's
> doing it... and asking him directly hasn't worked.

You could try dumping the link symbols from the binary to see what API
it's using. This is especially helpful if it's an undocumented
interface.

HTH,
 -r


More information about the theora-dev mailing list