ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/CV.xs
(Generate patch)

Comparing CV/CV.xs (file contents):
Revision 1.64 by root, Wed Dec 1 03:32:40 2021 UTC vs.
Revision 1.67 by root, Fri May 12 01:23:57 2023 UTC

302///////////////////////////////////////////////////////////////////////////// 302/////////////////////////////////////////////////////////////////////////////
303 303
304MODULE = Gtk2::CV PACKAGE = Gtk2::CV 304MODULE = Gtk2::CV PACKAGE = Gtk2::CV
305 305
306PROTOTYPES: ENABLE 306PROTOTYPES: ENABLE
307
308void
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 :)
310int 313int
311common_prefix_length (a, b) 314common_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 607
596 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;
597 616
598 perlinterp_release (); 617 perlinterp_release ();
599 618
600 dec = JxlDecoderCreate (0); 619 dec = JxlDecoderCreate (0);
601 620
602 error = "JxlDecoderCreate failed"; 621 error = "JxlDecoderCreate failed";
603 if (!dec) 622 if (!dec)
604 goto done; 623 goto done;
605
606 runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ());
607 624
608 status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); 625 status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner);
609 error = "JxlDecoderSetParallelRunner failed"; 626 error = "JxlDecoderSetParallelRunner failed";
610 if (status != JXL_DEC_SUCCESS) 627 if (status != JXL_DEC_SUCCESS)
611 goto done; 628 goto done;
687 704
688 done: 705 done:
689 if (dec) 706 if (dec)
690 JxlDecoderDestroy (dec); 707 JxlDecoderDestroy (dec);
691 708
709 perlinterp_acquire ();
710
692 if (runner) 711 if (runner_cache)
693 JxlThreadParallelRunnerDestroy (runner); 712 JxlThreadParallelRunnerDestroy (runner);
694 713
695 perlinterp_acquire (); 714 runner_cache = runner;
696 715
697 if (error) 716 if (error)
698 { 717 {
699 if (RETVAL) 718 if (RETVAL)
700 g_object_unref (RETVAL); 719 g_object_unref (RETVAL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines