[MPlayer-dev-eng] [PATCH] Port codebase to Theora 1.0 API
Diego Biurrun
diego at biurrun.de
Fri Dec 16 18:08:21 CET 2011
On Fri, Dec 16, 2011 at 03:47:25PM +0100, Giorgio Vazzana wrote:
>
> libtheora 1.0 was released on November 3, 2008. That was more than
> three years ago and all distributions are now using the 1.x series.
> This patch updates the current MPlayer code to the libtheora 1.0 C
> API. Regards,
Note that I have no opinion on the patch itself, but ..
> --- configure (revision 34447)
> +++ configure (working copy)
> @@ -6234,53 +6234,51 @@
> if test "$_theora" = auto ; then
> _theora=no
> cat > $TMPC << EOF
> -#include <theora/theora.h>
> -#include <string.h>
> +#include <theora/theoradec.h>
> int main(void) {
> /* Theora is in flux, make sure that all interface routines and datatypes
> * exist and work the way we expect it, so we don't break MPlayer. */
.. this comment should be removed ..
> ogg_packet op;
> - theora_comment tc;
> - theora_info inf;
> - theora_state st;
> - yuv_buffer yuv;
> + th_comment tc;
> + th_info ti;
> + th_setup_info *tsi = NULL;
> + th_dec_ctx *tctx;
> + th_ycbcr_buffer ycbcrbuf;
> int r;
> double t;
>
> - theora_info_init(&inf);
> - theora_comment_init(&tc);
> + th_info_init(&ti);
> + th_comment_init(&tc);
>
> return 0;
>
> /* we don't want to execute this kind of nonsense; just for making sure
> * that compilation works... */
.. same as this one and ..
> - memset(&op, 0, sizeof(op));
> - r = theora_decode_header(&inf, &tc, &op);
> - r = theora_decode_init(&st, &inf);
> - t = theora_granule_time(&st, op.granulepos);
> - r = theora_decode_packetin(&st, &op);
> - r = theora_decode_YUVout(&st, &yuv);
> - theora_clear(&st);
> -
> - return 0;
> + r = th_decode_headerin(&ti, &tc, &tsi, &op);
> + tctx = th_decode_alloc(&ti, tsi);
> + th_setup_free(tsi);
> + t = th_granule_time(tctx, op.granulepos);
> + r = th_decode_packetin(tctx, &op, NULL);
> + r = th_decode_ycbcr_out(tctx, ycbcrbuf);
> + th_decode_free(tctx);
.. I wonder why the Theora check has to be so complicated to begin
with when 90% of the other codec library checks can be accomplished
with a simple function invocation.
Diego
More information about the MPlayer-dev-eng
mailing list