… | |
… | |
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+1] == (U8)'B' |
|
|
492 | && data[0x8000+2] == (U8)'E' |
|
|
493 | && data[0x8000+3] == (U8)'A' |
|
|
494 | && data[0x8000+4] == (U8)'0' |
|
|
495 | && data[0x8000+5] == (U8)'1') |
|
|
496 | RETVAL = "video/iso-bluray"; |
|
|
497 | else if (data_len >= 0x8000 + 6 |
|
|
498 | && data[0x8000+1] == (U8)'C' |
|
|
499 | && data[0x8000+2] == (U8)'D' |
|
|
500 | && data[0x8000+3] == (U8)'0' |
|
|
501 | && data[0x8000+4] == (U8)'0' |
|
|
502 | && data[0x8000+5] == (U8)'1') |
|
|
503 | RETVAL = "video/iso9660"; |
487 | |
504 | |
488 | else |
505 | else |
489 | XSRETURN_UNDEF; |
506 | XSRETURN_UNDEF; |
490 | } |
507 | } |
491 | OUTPUT: |
508 | OUTPUT: |
… | |
… | |
589 | JxlBasicInfo info; |
606 | JxlBasicInfo info; |
590 | const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data); |
607 | const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data); |
591 | size_t avail_in = SvCUR (image_data); |
608 | size_t avail_in = SvCUR (image_data); |
592 | const char *error = 0; |
609 | const char *error = 0; |
593 | JxlDecoderStatus status; |
610 | JxlDecoderStatus status; |
|
|
611 | static void *runner_cache; |
594 | void *runner = 0; |
612 | void *runner = 0; |
595 | struct bmff_box box; |
|
|
596 | |
613 | |
597 | RETVAL = 0; |
614 | RETVAL = 0; |
|
|
615 | |
|
|
616 | if (runner_cache) |
|
|
617 | runner = runner_cache; |
|
|
618 | else |
|
|
619 | runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ()); |
|
|
620 | |
|
|
621 | runner_cache = 0; |
598 | |
622 | |
599 | perlinterp_release (); |
623 | perlinterp_release (); |
600 | |
624 | |
601 | dec = JxlDecoderCreate (0); |
625 | dec = JxlDecoderCreate (0); |
602 | |
626 | |
603 | error = "JxlDecoderCreate failed"; |
627 | error = "JxlDecoderCreate failed"; |
604 | if (!dec) |
628 | if (!dec) |
605 | goto done; |
629 | goto done; |
606 | |
|
|
607 | runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ()); |
|
|
608 | |
630 | |
609 | status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); |
631 | status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); |
610 | error = "JxlDecoderSetParallelRunner failed"; |
632 | error = "JxlDecoderSetParallelRunner failed"; |
611 | if (status != JXL_DEC_SUCCESS) |
633 | if (status != JXL_DEC_SUCCESS) |
612 | goto done; |
634 | goto done; |
… | |
… | |
688 | |
710 | |
689 | done: |
711 | done: |
690 | if (dec) |
712 | if (dec) |
691 | JxlDecoderDestroy (dec); |
713 | JxlDecoderDestroy (dec); |
692 | |
714 | |
|
|
715 | perlinterp_acquire (); |
|
|
716 | |
693 | if (runner) |
717 | if (runner_cache) |
694 | JxlThreadParallelRunnerDestroy (runner); |
718 | JxlThreadParallelRunnerDestroy (runner); |
695 | |
719 | |
696 | perlinterp_acquire (); |
720 | runner_cache = runner; |
697 | |
721 | |
698 | if (error) |
722 | if (error) |
699 | { |
723 | { |
700 | if (RETVAL) |
724 | if (RETVAL) |
701 | g_object_unref (RETVAL); |
725 | g_object_unref (RETVAL); |