… | |
… | |
302 | ///////////////////////////////////////////////////////////////////////////// |
302 | ///////////////////////////////////////////////////////////////////////////// |
303 | |
303 | |
304 | MODULE = Gtk2::CV PACKAGE = Gtk2::CV |
304 | MODULE = Gtk2::CV PACKAGE = Gtk2::CV |
305 | |
305 | |
306 | PROTOTYPES: ENABLE |
306 | PROTOTYPES: ENABLE |
|
|
307 | |
|
|
308 | void |
|
|
309 | _exit (int code) |
307 | |
310 | |
308 | # calculate the common prefix length of two strings |
311 | # calculate the common prefix length of two strings |
309 | # missing function in perl. really :) |
312 | # missing function in perl. really :) |
310 | int |
313 | int |
311 | common_prefix_length (a, b) |
314 | common_prefix_length (a, b) |
… | |
… | |
482 | if (data_len >= ofs + 2 + 1 + 11) |
485 | if (data_len >= ofs + 2 + 1 + 11) |
483 | if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1)) |
486 | if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1)) |
484 | RETVAL = "video/gif"; |
487 | RETVAL = "video/gif"; |
485 | } |
488 | } |
486 | } |
489 | } |
|
|
490 | else if (data_len >= 0x8000 + 6 |
|
|
491 | && data[0x8000+0] == 0 |
|
|
492 | && data[0x8000+1] == (U8)'B' |
|
|
493 | && data[0x8000+2] == (U8)'E' |
|
|
494 | && data[0x8000+3] == (U8)'A' |
|
|
495 | && data[0x8000+4] == (U8)'0' |
|
|
496 | && data[0x8000+5] == (U8)'1') |
|
|
497 | RETVAL = "video/iso-bluray"; |
487 | |
498 | |
488 | else |
499 | else |
489 | XSRETURN_UNDEF; |
500 | XSRETURN_UNDEF; |
490 | } |
501 | } |
491 | OUTPUT: |
502 | OUTPUT: |
… | |
… | |
589 | JxlBasicInfo info; |
600 | JxlBasicInfo info; |
590 | const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data); |
601 | const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data); |
591 | size_t avail_in = SvCUR (image_data); |
602 | size_t avail_in = SvCUR (image_data); |
592 | const char *error = 0; |
603 | const char *error = 0; |
593 | JxlDecoderStatus status; |
604 | JxlDecoderStatus status; |
|
|
605 | static void *runner_cache; |
594 | void *runner = 0; |
606 | void *runner = 0; |
595 | struct bmff_box box; |
|
|
596 | |
607 | |
597 | RETVAL = 0; |
608 | RETVAL = 0; |
|
|
609 | |
|
|
610 | if (runner_cache) |
|
|
611 | runner = runner_cache; |
|
|
612 | else |
|
|
613 | runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ()); |
|
|
614 | |
|
|
615 | runner_cache = 0; |
598 | |
616 | |
599 | perlinterp_release (); |
617 | perlinterp_release (); |
600 | |
618 | |
601 | dec = JxlDecoderCreate (0); |
619 | dec = JxlDecoderCreate (0); |
602 | |
620 | |
603 | error = "JxlDecoderCreate failed"; |
621 | error = "JxlDecoderCreate failed"; |
604 | if (!dec) |
622 | if (!dec) |
605 | goto done; |
623 | goto done; |
606 | |
|
|
607 | runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ()); |
|
|
608 | |
624 | |
609 | status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); |
625 | status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); |
610 | error = "JxlDecoderSetParallelRunner failed"; |
626 | error = "JxlDecoderSetParallelRunner failed"; |
611 | if (status != JXL_DEC_SUCCESS) |
627 | if (status != JXL_DEC_SUCCESS) |
612 | goto done; |
628 | goto done; |
… | |
… | |
688 | |
704 | |
689 | done: |
705 | done: |
690 | if (dec) |
706 | if (dec) |
691 | JxlDecoderDestroy (dec); |
707 | JxlDecoderDestroy (dec); |
692 | |
708 | |
|
|
709 | perlinterp_acquire (); |
|
|
710 | |
693 | if (runner) |
711 | if (runner_cache) |
694 | JxlThreadParallelRunnerDestroy (runner); |
712 | JxlThreadParallelRunnerDestroy (runner); |
695 | |
713 | |
696 | perlinterp_acquire (); |
714 | runner_cache = runner; |
697 | |
715 | |
698 | if (error) |
716 | if (error) |
699 | { |
717 | { |
700 | if (RETVAL) |
718 | if (RETVAL) |
701 | g_object_unref (RETVAL); |
719 | g_object_unref (RETVAL); |