[MPlayer-dev-eng] [PATCH] Port codebase to Theora 1.0 API

Giorgio Vazzana mywing81 at gmail.com
Fri Dec 16 21:02:41 CET 2011


2011/12/16 Diego Biurrun <diego at biurrun.de>:
>>    /* 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 ..

Done.

>>    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 ..

Done.

>> -  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.

Yes, to be honest I wondered why the configure script had such a
complicate check in the first place too, but I didn't want to make too
many changes in one patch.
Anyway, in my opinion it's not necessary to include all that code,
this can be simplified a lot: we just need to include the header, call
a decode initialization function, and make sure that compiling and
linking go well. See then new patch attached.

Thank you,

Giorgio Vazzana
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002_theora_new_api.diff
Type: text/x-patch
Size: 14055 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20111216/c1439b13/attachment.bin>


More information about the MPlayer-dev-eng mailing list