diff --git a/multimedia/Makefile b/multimedia/Makefile index c4e01058e05a..d029970eedb9 100644 --- a/multimedia/Makefile +++ b/multimedia/Makefile @@ -1,467 +1,468 @@ COMMENT = Multimedia software SUBDIR += Bento4 SUBDIR += QtAV SUBDIR += ab25 SUBDIR += acidrip SUBDIR += aegisub SUBDIR += aom SUBDIR += aravis SUBDIR += arcan + SUBDIR += aribb24 SUBDIR += assimp SUBDIR += atomicparsley SUBDIR += audacious SUBDIR += audacious-plugins SUBDIR += av1an SUBDIR += avidemux SUBDIR += avidemux-cli SUBDIR += avidemux-plugins SUBDIR += avidemux-qt5 SUBDIR += avinfo SUBDIR += baka-mplayer SUBDIR += bcmatroska2 SUBDIR += bino SUBDIR += bitstream SUBDIR += blind SUBDIR += bsdbktr_tvtune SUBDIR += butt SUBDIR += camserv SUBDIR += ccextractor SUBDIR += cclive SUBDIR += celluloid SUBDIR += cheese SUBDIR += chilitags SUBDIR += cineencoder SUBDIR += clive SUBDIR += clutter-gst SUBDIR += clutter-gst3 SUBDIR += cmrt SUBDIR += cmrtlib SUBDIR += cx88 SUBDIR += dav1d SUBDIR += deforaos-player SUBDIR += dirac SUBDIR += dragon SUBDIR += dtv-scan-tables SUBDIR += dumpmpeg SUBDIR += dv2sub SUBDIR += dvb-apps SUBDIR += dvbcut SUBDIR += dvbsnoop SUBDIR += dvd-slideshow SUBDIR += dvdauthor SUBDIR += dvdid SUBDIR += dvdread SUBDIR += dvdrip SUBDIR += dvdstyler SUBDIR += elementary-videos SUBDIR += emby-server SUBDIR += emovix SUBDIR += ffaudioconverter SUBDIR += ffdec SUBDIR += ffmpeg SUBDIR += ffmpeg2theora SUBDIR += ffmpegthumbnailer SUBDIR += ffms2 SUBDIR += filebot SUBDIR += flvmeta SUBDIR += flvstreamer SUBDIR += flvtool++ SUBDIR += fpc-dts SUBDIR += fpc-libvlc SUBDIR += fxtv SUBDIR += gaupol SUBDIR += gavl SUBDIR += gdialog SUBDIR += get_iplayer SUBDIR += gmerlin SUBDIR += gmmlib SUBDIR += gmp-api SUBDIR += gmtk SUBDIR += gnome-mplayer SUBDIR += gnome-twitch SUBDIR += gpac-libgpac SUBDIR += gpac-mp4box SUBDIR += gpodder SUBDIR += grake SUBDIR += gst123 SUBDIR += gstreamer1 SUBDIR += gstreamer1-editing-services SUBDIR += gstreamer1-libav SUBDIR += gstreamer1-plugins SUBDIR += gstreamer1-plugins-all SUBDIR += gstreamer1-plugins-aom SUBDIR += gstreamer1-plugins-assrender SUBDIR += gstreamer1-plugins-bad SUBDIR += gstreamer1-plugins-core SUBDIR += gstreamer1-plugins-dash SUBDIR += gstreamer1-plugins-dts SUBDIR += gstreamer1-plugins-dv SUBDIR += gstreamer1-plugins-dvdread SUBDIR += gstreamer1-plugins-gnonlin SUBDIR += gstreamer1-plugins-good SUBDIR += gstreamer1-plugins-hls SUBDIR += gstreamer1-plugins-kate SUBDIR += gstreamer1-plugins-libde265 SUBDIR += gstreamer1-plugins-mpeg2dec SUBDIR += gstreamer1-plugins-mpeg2enc SUBDIR += gstreamer1-plugins-mplex SUBDIR += gstreamer1-plugins-msdk SUBDIR += gstreamer1-plugins-openh264 SUBDIR += gstreamer1-plugins-resindvd SUBDIR += gstreamer1-plugins-rtmp SUBDIR += gstreamer1-plugins-rust SUBDIR += gstreamer1-plugins-smoothstreaming SUBDIR += gstreamer1-plugins-svt-av1 SUBDIR += gstreamer1-plugins-svt-hevc SUBDIR += gstreamer1-plugins-svt-vp9 SUBDIR += gstreamer1-plugins-theora SUBDIR += gstreamer1-plugins-ttml SUBDIR += gstreamer1-plugins-ugly SUBDIR += gstreamer1-plugins-v4l2 SUBDIR += gstreamer1-plugins-vpx SUBDIR += gstreamer1-plugins-x264 SUBDIR += gstreamer1-plugins-x265 SUBDIR += gstreamer1-qt SUBDIR += gstreamer1-rtsp-server SUBDIR += gstreamer1-transcoder SUBDIR += gstreamer1-vaapi SUBDIR += gstreamer1-validate SUBDIR += gstreamermm SUBDIR += gtk-youtube-viewer SUBDIR += handbrake SUBDIR += haruna SUBDIR += harvid SUBDIR += helvum SUBDIR += hypnotix SUBDIR += imagination SUBDIR += intel-media-sdk SUBDIR += iriverter SUBDIR += iso2mkv SUBDIR += jmref SUBDIR += kaffeine SUBDIR += kamoso SUBDIR += kdemultimedia SUBDIR += kdemultimedia-ffmpegthumbs SUBDIR += kdenlive SUBDIR += kf5-kmediaplayer SUBDIR += kmplayer SUBDIR += kodi SUBDIR += kodi-addon-inputstream.adaptive SUBDIR += kodi-addon-peripheral.joystick SUBDIR += kodi-addon-pvr.hts SUBDIR += kodi-addon-pvr.iptvsimple SUBDIR += kodi-addon-screensaver.biogenesis SUBDIR += kodi-addon-screensaver.matrixtrails SUBDIR += kodi-addon-screensaver.stars SUBDIR += kodi-addon-visualization.fishbmc SUBDIR += kodi-addon-visualization.shadertoy SUBDIR += kodi-addon-visualization.spectrum SUBDIR += kooha SUBDIR += kvazaar SUBDIR += l-smash SUBDIR += lebiniou SUBDIR += lebiniou-data SUBDIR += libaacs SUBDIR += libass SUBDIR += libbdplus SUBDIR += libbluray SUBDIR += libcec SUBDIR += libdc1394 SUBDIR += libdca SUBDIR += libdcadec SUBDIR += libde265 SUBDIR += libdv SUBDIR += libdvbcsa SUBDIR += libdvbpsi SUBDIR += libdvdcss SUBDIR += libdvdnav SUBDIR += libdvdread SUBDIR += libfame SUBDIR += libgav1 SUBDIR += libhdhomerun SUBDIR += libkate SUBDIR += libmatroska SUBDIR += libmediaart SUBDIR += libmediainfo SUBDIR += libmpeg2 SUBDIR += libmpeg3 SUBDIR += libmtp SUBDIR += libndi SUBDIR += libopenshot SUBDIR += libquicktime SUBDIR += libquicktime-lame SUBDIR += libquvi SUBDIR += libquvi-scripts SUBDIR += libquvi-scripts09 SUBDIR += libquvi09 SUBDIR += librav1e SUBDIR += librespot SUBDIR += librist SUBDIR += librtmp SUBDIR += libtheora SUBDIR += libtuner SUBDIR += libuvc SUBDIR += libv4l SUBDIR += libva SUBDIR += libva-glx SUBDIR += libva-intel-driver SUBDIR += libva-intel-hybrid-driver SUBDIR += libva-intel-media-driver SUBDIR += libva-utils SUBDIR += libva-vdpau-driver SUBDIR += libvdpau SUBDIR += libvdpau-va-gl SUBDIR += libvlcpp SUBDIR += libvpx SUBDIR += libx264 SUBDIR += libxine SUBDIR += libxspf SUBDIR += libzen SUBDIR += linux-c7-libtheora SUBDIR += linux-c7-libv4l SUBDIR += linux-tsmuxer SUBDIR += linux_dvbwrapper-kmod SUBDIR += livego SUBDIR += lives SUBDIR += livestreamer SUBDIR += lms SUBDIR += lsdvd SUBDIR += m2tstoavi SUBDIR += m2vrequantiser SUBDIR += makemkv SUBDIR += mediainfo SUBDIR += mencoder SUBDIR += minisatip SUBDIR += minitube SUBDIR += mjpegtools SUBDIR += mjpg-streamer SUBDIR += mkclean SUBDIR += mkvalidator SUBDIR += mkvtoolnix SUBDIR += mkxvcd SUBDIR += mlt6 SUBDIR += mlt6-qt5 SUBDIR += mlt7 SUBDIR += mlt7-qt5 SUBDIR += mmsrip SUBDIR += motion SUBDIR += mp3cd SUBDIR += mp4v2 SUBDIR += mpc-qt SUBDIR += mpeg2codec SUBDIR += mpeg2play SUBDIR += mpeg_encode SUBDIR += mpeg_play SUBDIR += mpeg_stat SUBDIR += mpgtx SUBDIR += mplayer SUBDIR += mplayer-skins SUBDIR += mplex SUBDIR += mps-youtube SUBDIR += mpv SUBDIR += mpv-mpris SUBDIR += mpvpaper SUBDIR += msdl SUBDIR += msopenh264 SUBDIR += mswebrtc SUBDIR += musikcube SUBDIR += musique SUBDIR += mxflib SUBDIR += mythtv SUBDIR += mythtv-frontend SUBDIR += naludump SUBDIR += navidrome SUBDIR += neolink SUBDIR += nordlicht SUBDIR += nostt SUBDIR += nymphcast SUBDIR += nymphcastlib SUBDIR += nymphrpc SUBDIR += obs-audio-spectralizer SUBDIR += obs-ndi SUBDIR += obs-qtwebkit SUBDIR += obs-scrab SUBDIR += obs-streamfx SUBDIR += obs-studio SUBDIR += obs-transition-matrix SUBDIR += obs-v4l2sink SUBDIR += obs-websocket SUBDIR += oggvideotools SUBDIR += ogmrip SUBDIR += ogmtools SUBDIR += olive SUBDIR += omxplayer SUBDIR += onevpl SUBDIR += openh264 SUBDIR += openshot SUBDIR += opentimelineio SUBDIR += opentoonz SUBDIR += oscam SUBDIR += p5-Audio-M4P SUBDIR += p5-FFmpeg-Command SUBDIR += p5-FLV-Info SUBDIR += p5-File-Format-RIFF SUBDIR += p5-MP4-Info SUBDIR += p5-Net-UPnP SUBDIR += p5-Subtitles SUBDIR += p5-Umph-Prompt SUBDIR += pHash SUBDIR += peek SUBDIR += phonon SUBDIR += phonon-designerplugin SUBDIR += phonon-gstreamer SUBDIR += phonon-vlc SUBDIR += photofilmstrip SUBDIR += php-pHash SUBDIR += pipewire SUBDIR += pitivi SUBDIR += playerctl SUBDIR += plexmediaserver SUBDIR += plexmediaserver-plexpass SUBDIR += podcastdl SUBDIR += poe SUBDIR += ppm2fli SUBDIR += projectx SUBDIR += ptx-kmod SUBDIR += pwcbsd SUBDIR += pwcview SUBDIR += py-PySceneDetect SUBDIR += py-av SUBDIR += py-cec SUBDIR += py-enzyme SUBDIR += py-ffmpeg-python SUBDIR += py-gstreamer1 SUBDIR += py-guessit SUBDIR += py-librtmp SUBDIR += py-mat2 SUBDIR += py-metadata-cleaner SUBDIR += py-mido SUBDIR += py-mlt6 SUBDIR += py-moviepy SUBDIR += py-opentimelineio SUBDIR += py-periscope SUBDIR += py-pretty_midi SUBDIR += py-pymediainfo SUBDIR += py-soco SUBDIR += py-subliminal SUBDIR += py-tvnamer SUBDIR += qmmp-plugin-pack-qt5 SUBDIR += qmmp-qt5 SUBDIR += qpwgraph SUBDIR += qt-faststart SUBDIR += qt5-multimedia SUBDIR += quodlibet SUBDIR += quvi SUBDIR += quvi09 SUBDIR += qwinff SUBDIR += rage SUBDIR += rav1e SUBDIR += recmpeg SUBDIR += recordmydesktop SUBDIR += replex SUBDIR += rtmpdump SUBDIR += rubygem-av SUBDIR += rubygem-clutter-gstreamer SUBDIR += rubygem-flvtool2 SUBDIR += rubygem-gstreamer SUBDIR += rubygem-paperclip-av-transcoder SUBDIR += rubygem-paperclip-av-transcoder-rails50 SUBDIR += rubygem-streamio-ffmpeg SUBDIR += sabbu SUBDIR += schroedinger SUBDIR += scte35dump SUBDIR += shotcut SUBDIR += simplescreenrecorder SUBDIR += smpeg SUBDIR += smpeg2 SUBDIR += smplayer SUBDIR += smplayer-skins SUBDIR += smplayer-themes SUBDIR += smtube SUBDIR += snapcast SUBDIR += snappy SUBDIR += spigot SUBDIR += spook SUBDIR += streamlink SUBDIR += subsync SUBDIR += subtitlecomposer SUBDIR += subtitleoffsetmodifier SUBDIR += subtitleripper SUBDIR += subtools SUBDIR += svt-av1 SUBDIR += svt-hevc SUBDIR += svt-vp9 SUBDIR += syncplay SUBDIR += szap-s2 SUBDIR += tautulli SUBDIR += tcmplex-panteltje SUBDIR += termplay SUBDIR += tinyobjloader SUBDIR += tivodecode SUBDIR += totem SUBDIR += totem-pl-parser SUBDIR += transcode SUBDIR += tstools SUBDIR += tvheadend SUBDIR += umph SUBDIR += ustreamer SUBDIR += v4l-utils SUBDIR += v4l_compat SUBDIR += vamps SUBDIR += vapoursynth SUBDIR += vapoursynth-l-smash-works SUBDIR += vapoursynth-vmaf SUBDIR += vcdgear SUBDIR += vcdimager SUBDIR += vdpauinfo SUBDIR += vdr SUBDIR += vdr-plugin-control SUBDIR += vdr-plugin-eepg SUBDIR += vdr-plugin-epgsearch SUBDIR += vdr-plugin-extrecmenu SUBDIR += vdr-plugin-femon SUBDIR += vdr-plugin-infosatepg SUBDIR += vdr-plugin-iptv SUBDIR += vdr-plugin-markad SUBDIR += vdr-plugin-osdpip SUBDIR += vdr-plugin-osdteletext SUBDIR += vdr-plugin-reelchannelscan SUBDIR += vdr-plugin-remote SUBDIR += vdr-plugin-skinenigmang SUBDIR += vdr-plugin-sleeptimer SUBDIR += vdr-plugin-streamdev SUBDIR += vdr-plugin-ttxtsubs SUBDIR += vdr-plugin-vdrmanager SUBDIR += vdr-plugin-vnsiserver SUBDIR += vdr-plugin-wirbelscan SUBDIR += vdr-plugin-xineliboutput SUBDIR += vdr-plugin-xvdr SUBDIR += vdr-plugins SUBDIR += vid.stab SUBDIR += vlc SUBDIR += vmaf SUBDIR += vtkmpeg2encode SUBDIR += vvdec SUBDIR += w_scan2 SUBDIR += webcamd SUBDIR += webcamoid SUBDIR += webvfx-qt5 SUBDIR += wf-recorder SUBDIR += win32-codecs SUBDIR += winff SUBDIR += wlrobs SUBDIR += x264 SUBDIR += x265 SUBDIR += xanim SUBDIR += xawtv SUBDIR += xfce4-parole SUBDIR += xine SUBDIR += xporthdmv SUBDIR += xvid SUBDIR += yamdi SUBDIR += ytfzf SUBDIR += zart SUBDIR += zoneminder .include diff --git a/multimedia/aribb24/Makefile b/multimedia/aribb24/Makefile new file mode 100644 index 000000000000..cf51a8e44ffc --- /dev/null +++ b/multimedia/aribb24/Makefile @@ -0,0 +1,25 @@ +PORTNAME= aribb24 +DISTVERSION= 1.0.4 +CATEGORIES= multimedia + +MAINTAINER= driesm@FreeBSD.org +COMMENT= ARIB STD-B24 library + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libpng.so:graphics/png + +USES= autoreconf libtool pkgconfig +USE_GITHUB= yes +GH_ACCOUNT= jeeb +GH_TAGNAME= a41b904 +USE_LDCONFIG= yes + +GNU_CONFIGURE= yes + +INSTALL_TARGET= install-strip + +OPTIONS_DEFINE= DOCS + +.include diff --git a/multimedia/aribb24/distinfo b/multimedia/aribb24/distinfo new file mode 100644 index 000000000000..a8f0302bba7c --- /dev/null +++ b/multimedia/aribb24/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1644955608 +SHA256 (jeeb-aribb24-1.0.4-a41b904_GH0.tar.gz) = bff07228a919309263bea08eb880efa9376dca5b4ec19ce9b404d175504da596 +SIZE (jeeb-aribb24-1.0.4-a41b904_GH0.tar.gz) = 47404 diff --git a/multimedia/aribb24/files/patch-src_aribb24__private.h b/multimedia/aribb24/files/patch-src_aribb24__private.h new file mode 100644 index 000000000000..2c4a0a61e0c9 --- /dev/null +++ b/multimedia/aribb24/files/patch-src_aribb24__private.h @@ -0,0 +1,16 @@ +https://github.com/scimmia9286/aribb24/commit/fa54dee41aa38560f02868b24f911a24c33780a8 +--- src/aribb24_private.h.orig 2019-09-16 15:57:19 UTC ++++ src/aribb24_private.h +@@ -35,9 +35,9 @@ struct arib_instance_private_t + char *psz_last_error; + + drcs_conversion_t *p_drcs_conv; +- int i_drcs_num; +- unsigned int drcs_conv_table[188]; +- char drcs_hash_table[188][32 + 1]; ++ int i_drcs_num[15]; ++ unsigned int drcs_conv_table[15][188]; ++ char drcs_hash_table[15][188][32 + 1]; + }; + + void arib_log( arib_instance_t *, const char *, ... ); diff --git a/multimedia/aribb24/files/patch-src_decoder.c b/multimedia/aribb24/files/patch-src_decoder.c new file mode 100644 index 000000000000..8bf46be2353f --- /dev/null +++ b/multimedia/aribb24/files/patch-src_decoder.c @@ -0,0 +1,89 @@ +https://github.com/scimmia9286/aribb24/commit/fa54dee41aa38560f02868b24f911a24c33780a8 +--- src/decoder.c.orig 2019-09-16 15:57:19 UTC ++++ src/decoder.c +@@ -82,6 +82,7 @@ struct arib_decoder_t + int (*handle_g2)(arib_decoder_t *, int); + int (*handle_g3)(arib_decoder_t *, int); + int kanji_ku; ++ int drcs_plane; + + int i_control_time; + +@@ -448,11 +449,8 @@ static int decoder_handle_drcs( arib_decoder_t *decode + { + unsigned int uc; + +- uc = 0; +- if( c < decoder->p_instance->p->i_drcs_num ) +- { +- uc = decoder->p_instance->p->drcs_conv_table[c]; +- } ++ uc = decoder->p_instance->p->drcs_conv_table[decoder->drcs_plane-1][c]; ++ + if( uc == 0 ) + { + /* uc = 0x3000; */ /* WHITESPACE */ +@@ -555,6 +553,7 @@ static int decoder_handle_esc( arib_decoder_t *decoder + { + int c; + int (**handle)(arib_decoder_t *, int); ++ int drcs = 0; + + handle = &decoder->handle_g0; + while( decoder_pull( decoder, &c ) != 0 ) +@@ -562,6 +561,7 @@ static int decoder_handle_esc( arib_decoder_t *decoder + switch( c ) + { + case 0x20: // DRCS ++ drcs = 1; + break; + case 0x24: + case 0x28: +@@ -585,12 +585,29 @@ static int decoder_handle_esc( arib_decoder_t *decoder + return 1; + case 0x39: + case 0x3b: +- case 0x42: + *handle = decoder_handle_kanji; + return 1; ++ case 0x42: ++ if (drcs==1) ++ { ++ decoder->drcs_plane = c-0x40; ++ *handle = decoder_handle_drcs; ++ } ++ else ++ { ++ *handle = decoder_handle_kanji; ++ } + case 0x36: + case 0x4a: +- *handle = decoder_handle_alnum; ++ if (drcs==1) ++ { ++ decoder->drcs_plane = c-0x40; ++ *handle = decoder_handle_drcs; ++ } ++ else ++ { ++ *handle = decoder_handle_alnum; ++ } + return 1; + case 0x40: + case 0x41: +@@ -608,6 +625,7 @@ static int decoder_handle_esc( arib_decoder_t *decoder + case 0x4d: + case 0x4e: + case 0x4f: ++ decoder->drcs_plane = c-0x40; + *handle = decoder_handle_drcs; + return 1; + case 0x6e: //LS2 +@@ -1401,6 +1419,7 @@ void arib_initialize_decoder( arib_decoder_t* decoder + decoder->handle_g2 = decoder_handle_hiragana; + decoder->handle_g3 = decoder_handle_katakana; + decoder->kanji_ku = -1; ++ decoder->drcs_plane = -1; + + decoder->i_control_time = 0; + diff --git a/multimedia/aribb24/files/patch-src_drcs.c b/multimedia/aribb24/files/patch-src_drcs.c new file mode 100644 index 000000000000..10c542158494 --- /dev/null +++ b/multimedia/aribb24/files/patch-src_drcs.c @@ -0,0 +1,89 @@ +https://github.com/scimmia9286/aribb24/commit/58a34b8fabf4d0e9e1984fb603a97f52fb934a09 +https://github.com/scimmia9286/aribb24/commit/fa54dee41aa38560f02868b24f911a24c33780a8 +--- src/drcs.c.orig 2019-09-16 15:57:19 UTC ++++ src/drcs.c +@@ -127,32 +127,39 @@ static bool create_arib_datadir( arib_instance_t *p_in + + bool apply_drcs_conversion_table( arib_instance_t *p_instance ) + { +- for( int i = 0; i < p_instance->p->i_drcs_num; i++ ) ++ for( int i = 0; i < 15; i++ ) + { +- unsigned int uc = 0; +- drcs_conversion_t *p_drcs_conv = p_instance->p->p_drcs_conv; +- while( p_drcs_conv != NULL ) ++ for( int j = 0; j < p_instance->p->i_drcs_num[i]; j++ ) + { +- if( strcmp( p_drcs_conv->hash, p_instance->p->drcs_hash_table[i] ) == 0 ) ++ if (p_instance->p->drcs_hash_table[i][j][0] != 0) + { +- uc = p_drcs_conv->code; +- break; +- } +- p_drcs_conv = p_drcs_conv->p_next; +- } ++ unsigned int uc = 0; ++ drcs_conversion_t *p_drcs_conv = p_instance->p->p_drcs_conv; ++ while( p_drcs_conv != NULL ) ++ { ++ if( strcmp( p_drcs_conv->hash, p_instance->p->drcs_hash_table[i][j] ) == 0 ) ++ { ++ uc = p_drcs_conv->code; ++ break; ++ } ++ p_drcs_conv = p_drcs_conv->p_next; ++ } ++ + #ifdef DEBUG_ARIBSUB +- if( uc ) +- { +- arib_log( p_instance, "Mapping [%s=U+%04x] will be used.", +- p_instance->p->drcs_hash_table[i], uc ); +- } +- else +- { +- arib_log( p_instance, "Mapping for hash[%s] is not found.", +- p_instance->p->drcs_hash_table[i] ); +- } ++ if( uc ) ++ { ++ arib_log( p_instance, "Mapping [%s=U+%04x] will be used.", ++ p_instance->p->drcs_hash_table[i][j], uc ); ++ } ++ else ++ { ++ arib_log( p_instance, "Mapping for hash[%s] is not found.", ++ p_instance->p->drcs_hash_table[i][j] ); ++ } + #endif +- p_instance->p->drcs_conv_table[i] = uc; ++ p_instance->p->drcs_conv_table[i][j] = uc; ++ } ++ } + } + return true; + } +@@ -406,15 +413,19 @@ png_create_write_struct_failed: + void save_drcs_pattern( + arib_instance_t *p_instance, + int i_width, int i_height, +- int i_depth, const int8_t* p_patternData ) ++ int i_depth, const int8_t* p_patternData, ++ int16_t i_CharacterCode ) + { ++ int i_drcsPlane = ((i_CharacterCode >> 8) & 0xff) - 0x40; ++ int i_code = (i_CharacterCode & 0xff) - 0x20; + char* psz_hash = get_drcs_pattern_data_hash( p_instance, + i_width, i_height, i_depth, p_patternData ); + +- strncpy( p_instance->p->drcs_hash_table[p_instance->p->i_drcs_num], psz_hash, 32 ); +- p_instance->p->drcs_hash_table[p_instance->p->i_drcs_num][32] = '\0'; ++ strncpy( p_instance->p->drcs_hash_table[i_drcsPlane-1][i_code-1], psz_hash, 32 ); ++ p_instance->p->drcs_hash_table[i_drcsPlane-1][i_code-1][32] = '\0'; + +- p_instance->p->i_drcs_num++; ++ p_instance->p->i_drcs_num[i_drcsPlane-1] = i_code > p_instance->p->i_drcs_num[i_drcsPlane-1] ? ++ i_code : p_instance->p->i_drcs_num[i_drcsPlane-1]; + + save_drcs_pattern_data_image( p_instance, psz_hash, + i_width, i_height, i_depth, p_patternData ); diff --git a/multimedia/aribb24/files/patch-src_drcs.h b/multimedia/aribb24/files/patch-src_drcs.h new file mode 100644 index 000000000000..2fbb9f7f6d80 --- /dev/null +++ b/multimedia/aribb24/files/patch-src_drcs.h @@ -0,0 +1,11 @@ +https://github.com/scimmia9286/aribb24/commit/58a34b8fabf4d0e9e1984fb603a97f52fb934a09 +--- src/drcs.h.orig 2019-09-16 15:57:19 UTC ++++ src/drcs.h +@@ -77,6 +77,6 @@ typedef struct drcs_data_s + + bool apply_drcs_conversion_table( arib_instance_t * ); + bool load_drcs_conversion_table( arib_instance_t * ); +-void save_drcs_pattern( arib_instance_t *, int, int, int, const int8_t* ); ++void save_drcs_pattern( arib_instance_t *, int, int, int, const int8_t*, int16_t ); + + #endif diff --git a/multimedia/aribb24/files/patch-src_parser.c b/multimedia/aribb24/files/patch-src_parser.c new file mode 100644 index 000000000000..9a8616b32d34 --- /dev/null +++ b/multimedia/aribb24/files/patch-src_parser.c @@ -0,0 +1,85 @@ +https://github.com/scimmia9286/aribb24/commit/58a34b8fabf4d0e9e1984fb603a97f52fb934a09 +https://github.com/scimmia9286/aribb24/commit/fa54dee41aa38560f02868b24f911a24c33780a8 +--- src/parser.c.orig 2019-09-16 15:57:19 UTC ++++ src/parser.c +@@ -79,7 +79,6 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par + uint8_t i_data_unit_parameter, + uint32_t i_data_unit_size ) + { +- p_parser->p_instance->p->i_drcs_num = 0; + #ifdef ARIBSUB_GEN_DRCS_DATA + if( p_parser->p_drcs_data != NULL ) + { +@@ -119,7 +118,7 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par + + for( int i = 0; i < i_NumberOfCode; i++ ) + { +- bs_skip( p_bs, 16 ); /* i_character_code */ ++ int16_t i_CharacterCode = bs_read( p_bs, 16 ); /* i_character_code */ + p_parser->i_data_unit_size += 2; + uint8_t i_NumberOfFont = bs_read( p_bs, 8 ); + p_parser->i_data_unit_size += 1; +@@ -139,7 +138,11 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par + + for( int j = 0; j < i_NumberOfFont; j++ ) + { ++#ifdef ARIBSUB_GEN_DRCS_DATA ++ int8_t i_fontId = bs_read( p_bs, 4 ); /* i_fontID */ ++#else + bs_skip( p_bs, 4 ); /* i_fontID */ ++#endif //ARUBSUB_GEN_DRCS_DATA + uint8_t i_mode = bs_read( p_bs, 4 ); + p_parser->i_data_unit_size += 1; + +@@ -206,18 +209,26 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par + + #ifdef ARIBSUB_GEN_DRCS_DATA + save_drcs_pattern( p_parser->p_instance, i_width, i_height, i_depth + 2, +- p_drcs_pattern_data->p_patternData ); ++ p_drcs_pattern_data->p_patternData, i_CharacterCode ); + #else + save_drcs_pattern( p_parser->p_instance, i_width, i_height, i_depth + 2, +- p_patternData ); ++ p_patternData, i_CharacterCode ); + free( p_patternData ); + #endif //ARIBSUB_GEN_DRCS_DATA + } + else + { ++#ifdef ARIBSUB_GEN_DRCS_DATA ++ int8_t i_regionX = bs_read( p_bs, 8 ); /* i_regionX */ ++#else + bs_skip( p_bs, 8 ); /* i_regionX */ ++#endif //ARIBSUB_GEN_DRCS_DATA + p_parser->i_data_unit_size += 1; ++#ifdef ARIBSUB_GEN_DRCS_DATA ++ int8_t i_regionY = bs_read( p_bs, 8 ); /* i_regionY */ ++#else + bs_skip( p_bs, 8 ); /* i_regionY */ ++#endif //ARIBSUB_GEN_DRCS_DATA + p_parser->i_data_unit_size += 1; + uint16_t i_geometricData_length = bs_read( p_bs, 16 ); + p_parser->i_data_unit_size += 2; +@@ -245,7 +256,11 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par + + for( int k = 0; k < i_geometricData_length ; k++ ) + { ++#ifdef ARIBSUB_GEN_DRCS_DATA ++ int8_t i_geometricData = bs_read( p_bs, 8 ); /* i_geometric_data */ ++#else + bs_skip( p_bs, 8 ); /* i_geometric_data */ ++#endif //ARIBSUB_GEN_DRCS_DATA + p_parser->i_data_unit_size += 1; + + #ifdef ARIBSUB_GEN_DRCS_DATA +@@ -344,6 +359,10 @@ static void parse_caption_management_data( arib_parser + p_parser->i_data_unit_size = 0; + p_parser->i_subtitle_data_size = 0; + p_parser->psz_subtitle_data = NULL; ++ memset(p_parser->p_instance->p->i_drcs_num, 0, ++ sizeof(p_parser->p_instance->p->i_drcs_num)); ++ memset(p_parser->p_instance->p->drcs_hash_table, 0, ++ sizeof(p_parser->p_instance->p->drcs_hash_table)); + if( i_data_unit_loop_length > 0 ) + { + p_parser->psz_subtitle_data = (unsigned char*) calloc( diff --git a/multimedia/aribb24/pkg-descr b/multimedia/aribb24/pkg-descr new file mode 100644 index 000000000000..850a2011641e --- /dev/null +++ b/multimedia/aribb24/pkg-descr @@ -0,0 +1,4 @@ +A library for ARIB STD-B24, decoding JIS 8 bit characters +and parsing MPEG-TS stream. + +WWW: https://github.com/nkoriyama/aribb24 diff --git a/multimedia/aribb24/pkg-plist b/multimedia/aribb24/pkg-plist new file mode 100644 index 000000000000..4d457e6f4d91 --- /dev/null +++ b/multimedia/aribb24/pkg-plist @@ -0,0 +1,11 @@ +include/aribb24/aribb24.h +include/aribb24/bits.h +include/aribb24/decoder.h +include/aribb24/parser.h +lib/libaribb24.a +lib/libaribb24.so +lib/libaribb24.so.0 +lib/libaribb24.so.0.0.0 +libdata/pkgconfig/aribb24.pc +%%PORTDOCS%%%%DOCSDIR%%/COPYING +%%PORTDOCS%%%%DOCSDIR%%/README.md